(remote): detach by ending the ssh client, not a tmux prefix keystroke - #236
Merged
Merged
Conversation
…roke The detach path wrote Ctrl-B d before killing the local client, which assumes the remote host uses tmux's default prefix. On a host that remapped it the d lands as literal text in the attached session's composer. Ending the local ssh client is enough: the remote tmux client loses its pty and tmux drops it. Measured against the live host — the attached client count goes 1 then back to 0 and the session keeps running.
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.
Closing a remote session wrote Ctrl-B d to the attached pty before killing the
local ssh client. That hardcodes tmux's default prefix: on a host that remapped
it, the d is not a detach command but literal text typed into whatever the
remote session has focused — the Claude composer, for instance.
Ending the local ssh client is sufficient and prefix-agnostic: the remote tmux
client loses its pty and tmux drops it, leaving the session running.
Measured against the live host before changing anything — attach, then kill the
local client with no keystroke sent:
The grace period the keystroke needed goes with it, so closing a remote tab no
longer waits 150 ms.
Mutation proof: reintroducing the keystroke write turns the detach test red.