Repository navigation
🤖 fix: a pop-out terminal's exit closes only its own window - #5749
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ThomasK33
force-pushed
the
fix/popout-exit-closes-own-window
branch
from
October 6, 2026 13:44
fe281ae to
209bfbc
Compare
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.
Summary
In the desktop app, when the shell in one pop-out terminal window exits, only that window closes now. Other pop-out terminal windows of the same workspace stay open.
Fixes #5739
Background
terminal-window.tsxcalledterminal.closeWindow({ workspaceId })when its shell exited, andTerminalWindowManager.closeTerminalWindow(workspaceId)closed every pop-out of that workspace. Since #5732, those windows keep their sessions (app-closed windows are not user closes), but they were still hidden, and their shells came back as sidebar tabs on the next load.Implementation
terminal.closeWindowtakes an optionalsessionId(.nullish()). The pop-out window sends its own session when its shell exits.TerminalWindowRegistry(src/desktop/terminalWindowRegistry.ts) records which session each pop-out window shows, and selects the windows to close: only the one showingsessionId, or all of them when the field is absent (unchanged for other callers).TerminalWindowManageruses the registry instead of its ownMap<workspaceId, Set<BrowserWindow>>. I kept the registry free of Electron imports becauseterminalWindowManager.tscannot load under bun (electronhas noBrowserWindowexport there), so the close rule needed a testable home.TerminalService.getWorkspaceSessionIdsleft by 🤖 fix: fade sideways-scrolling rows, full skill descriptions, keep pop-out terminals out of the sidebar #5732 (flagged by that PR's final check).Validation
src/desktop/terminalWindowRegistry.test.ts"when one of two pop-outs exits, only its window is closed and the other stays open": two pop-outs are open in one workspace and one exits. The test asserts that only that window is selected, and that the other stays registered. With the old "close every window of the workspace" rule restored inside the registry, the test fails:No screenshots: the behavior exists only in the Electron app (in browser mode
closeWindowis a no-op on the server, and each browser pop-out is its own tab). I did not run Electron for this change. Its window wiring is the 1:1 replacement of the old Map/Set shown in the diff.Risks
Low. Callers that omit
sessionIdkeep the old close-all behavior. A pop-out opened without a session (none exist today, becauseopenTerminalPopoutalways passes one) is closed only by a close-all.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$16.86