Skip to content

(remote): detach by ending the ssh client, not a tmux prefix keystroke - #236

Merged
devsuitup merged 1 commit into
mainfrom
fix/remote-detach-no-prefix
Sep 9, 2026
Merged

devsuitup merged 1 commit into
mainfrom
fix/remote-detach-no-prefix

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

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:

clients before : 0
clients during : 1
clients after  : 0
session alive  : yes

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.

…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.
@devsuitup
devsuitup merged commit 9c6f466 into main Sep 9, 2026
10 checks passed
@devsuitup
devsuitup deleted the fix/remote-detach-no-prefix branch September 9, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant