Keep terminal mounted with an exit banner when a session dies - #58
Merged
abasiri merged 1 commit intoAug 2, 2026
Merged
Conversation
When a pre-launch command (or claude itself) fails fast, the renderer's onProcessExited handler was calling destroySession immediately, which disposes the xterm and removes the DOM element. Any stderr the failing command wrote (claude: command not found, devbox: unknown flag, shell errors, etc.) was destroyed with the terminal, leaving the user with no feedback — a blank terminal opens for a moment and vanishes. Write a styled "── session exited (code N) ──" banner into the terminal and defer the destroy. For Claude sessions the terminal stays mounted so the user can scroll back and read whatever was printed before the exit; re-clicking the session destroys + relaunches via the existing closed- entry branch in openSession. Plain terminal sessions remain ephemeral (destroyed and removed from the sidebar immediately).
JeanBaptisteRenard
referenced
this pull request
in devsuitup/switchboard
Jun 9, 2026
…exit-banner feat(terminal): keep terminal mounted with exit banner on session death (port upstream #58)
Bono2007
added a commit
to Bono2007/switchboard
that referenced
this pull request
Jul 27, 2026
Merges doctly#58 (keep the terminal mounted with an exit banner instead of destroying it) and fixes two things that stopped it helping the case it was written for. launchRemoteSession tags every remote session type:'terminal', Claude ones included, so doctly#58's ephemeral branch destroyed precisely the sessions whose exit reason matters most — a remote `claude` that is missing or not on the login shell's PATH exits with code 127 in under a second. Gate on remoteMode instead, matching the isRemoteClaude predicate already used in sidebar.js. Keeping those sessions mounted then made an existing bug reachable: re-clicking a closed one fell into the plain-terminal relaunch path and spawned a LOCAL shell in a directory literally named "ssh://host/dir". Remote sessions now relaunch on their host, and a session that never wrote a transcript relaunches fresh rather than failing on an unknown --resume id. That needed hostId on the session object, which only DB-indexed sessions carried until now. Verified against a real host with a deliberately failing pre-launch command: zsh:1: command not found: commande-qui-nexiste-pas-42 Shared connection to 10.0.0.191 closed. ── session exited (code 127) — re-click this session … ── and re-clicking relaunched a working remote session rather than a local one.
abasiri
marked this pull request as ready for review
August 2, 2026 00:01
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
Why this matters
This was triggered for me by an org-specific misconfiguration (using `devbox ai --cli` as a pre-launch command, which is actually an installer not a launcher — it exited non-zero and the terminal vanished), but it's a generic UX cliff for any failed launch: misspelled `preLaunchCmd`, missing `aws-vault` profile, etc.
Test plan