Repository navigation
fix(terminal): 避免关闭 Linux 集成终端时后台任务错过挂断 - #2441
Closed
devin-ai-integration[bot] wants to merge 12 commits into
Closed
devin-ai-integration[bot] wants to merge 12 commits into
devin-ai-integration[bot] wants to merge 12 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
requested review from
1lck,
Mucheen and
xiaoyumuxi
as code owners
November 26, 2026 12:08
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…atrix Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…fixture Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
16 of 17 tasks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
8 tasks done
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2 tasks done
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…is missing" This reverts commit bbed9df.
…prompts Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1lck
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
Closes #2054
PR 类型 / Type
改动说明 / What changes
背景 / Why
Linux 上关闭终端标签页时,刚启动的后台命令偶尔会在 shell 退出后继续运行。
改动 / Changes
disown和disown -h测试先取得 PID 并登记清理,再检查命令退出码。关闭后读取进程状态,僵尸进程会使断言失败。$!放到行尾,以兼容 macOS 的系统 Bash。终端目录用例等待 PTY 输出完整一行,覆盖分片读取。不在本 PR 范围内 / Out of scope
main 合入 #2446 后的 Release Core 冷构建超时和构建夹具对 profile、源码清单的处理已在 #2448 跟进。
类型专属:fix
复现与根因
在 Ubuntu 22.04.5 x86_64、Bash 5.1.16、main
5bdb7d36e的真实集成 PTY 内运行sleep 300 & echo job=$!,分别在输出 PID 时及下一个提示符显示后关闭。预期是后台任务随 shell 退出,实际观察到sleep被 PID 1 接管,5 秒后仍存活。d0a1b4944(#2026)引入了等待提示符的关闭路径。信号跟踪显示,提示符出现时,后台子进程仍可能没有 exec。Bash 已转发 SIGHUP,子进程用继承的处理器接收后仍然执行了 sleep。旧版本的 Linux Zsh 用例也可复现关闭后残留。Issue 报告中的 macOS 对照未复现。检查项
the shell's job … outlived the closed terminal by 5s。虚拟时钟测试在无子进程状态可依赖时,先观察到 0 或 60 毫秒即挂断,再验证修复后均在提示符出现 100 毫秒时挂断。2026-11-16-local-shell-integration-shim.md更新这一行为,沿用原决策的记录位置。范围检查 / Scope checks
功能矩阵 / Feature matrix
插件归属 / Plugin ownership
UI 验证 / UI evidence
N/A:终端后端进程生命周期,无视觉改动。
统一日志系统 / Structured logging
N/A:沿用原有关闭事件和终态,未增加日志。旧日志脚本的替代门禁未执行。
界面文案 / i18n
N/A:未改界面文案。已执行两个本地化检查。
逻辑归属 / Logic placement
性能与内存 / Performance and memory
设置 / Settings
N/A:无设置改动。
插件契约 / Plugin contract
N/A:无契约改动。
发行包与资源 / Bundle and resources
N/A:未改发行包或运行时资源。已运行 bundle 不可变检查。
无用代码与重构 / Dead code and refactoring
验证 / Verification
-count=100scripts/desktop/desktop-go.sh test ./...及改动的 localshell 用例计时检查-race -count=100,真实 disown 用例-count=15node --test scripts/desktop/verify/test-runtime-bundle-immutability.mjsscripts/desktop/desktop-go.sh test -race ./internal/localshell/... -count=1和vet ./internal/localshell/...go test -c ./internal/localshell未能执行的检查和原因:Linux 环境未运行 macOS、Windows 原生验收。
提交前确认 / Final checks
main@5bdb7d36e创建,已同步 main 的 fix(ci): 加速桌面端发布与 CI 流水线并共享 Release Core 成品缓存 #2446(59417db70)。Link to Devin session: https://app.devin.ai/sessions/f0ad3d1f037b4cf0b378c273311b8eb0
Open in Devin Desktop: https://app.devin.ai/desktop/session/f0ad3d1f037b4cf0b378c273311b8eb0?variant=devin
Requested by: @1lck