feat(terminal): keep terminal mounted with exit banner on session death (port upstream #58) - #42
Merged
Conversation
Port of upstream doctly#58 (author @HaydnG). The fork destroyed the terminal silently when a session process exited, which also swallowed stderr from a fast-failing pre-launch command. Now Claude sessions stay mounted and print an exit banner (dim on code 0, yellow otherwise) so the user can read what happened and relaunch by re-clicking. Plain terminal sessions remain ephemeral (destroyed on exit).
Merged
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.
Port of upstream doctly/switchboard#58 by @HaydnG.
Problem
The fork tore down the terminal silently the moment a session process exited (
onProcessExited→destroySession). A fast-failing pre-launch command (devbox/shell error) destroyed the terminal before the user could read the stderr.Fix
── session exited (code N) — re-click to relaunch, or click another to dismiss ──(dim on code 0, yellow otherwise). Cleanup deferred to the existing re-click/reconciliation path.Test
test/exit-banner.test.js(node:test). app.js is a load-time-monolithic renderer file, so the test exercises the portedonProcessExitedlogic via a mock harness mirroring the real state shapes (documented in the file) rather thanvm.runInContext— same approach trade-off noted in the fork's other renderer tests.Credit: @HaydnG / doctly#58.