fix(ssh): give up the wrapper's escape key on screen hosts - #175
Merged
Conversation
The tmux branch releases its prefix so a user's own tmux keeps C-b (#159), but the screen fallback kept screen's default C-a. The outer wrapper therefore swallowed it: a bare `C-a d` inside a nested screen detached *our* session, the SSH channel closed, and the app silently reconnected — the user's own screen never saw the key. screen has no `prefix None` equivalent; `escape` always names some key. It is now pointed at \377, a byte no key produces in a UTF-8 terminal, which is as close to "no escape key" as screen gets. The one theoretical cost is a latin-1 session where 0xFF is ÿ. Verified on a screen-only host (GNU screen 5.0.2) through the app: attached to the user's own session from inside a Voltius session, `C-a d` now prints `[detached from 9616.mine]` and leaves the wrapper attached, where before the wrapper flipped to (Detached) and reconnected underneath.
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.
Follow-up to #170 / #159, found while verifying the GNU screen half of that fix end to end.
The gap
#170 made the tmux wrapper transparent —
unset TMUX, andprefix NonesoC-bbelongs to whatever the user runs inside. The screen fallback got the environment half but not the key half: our screen rc sets noescape, so the wrapper kept screen's defaultC-aand intercepted it.Observed on a screen-only host, driving the app and polling the host while sending
C-a dfrom inside a nestedscreen -r:The SSH channel then closed and the app reconnected under the user — their own screen never saw
C-a.The fix
screen has no
prefix Noneequivalent:escapealways names some key. It is pointed at\377instead — a byte no key produces in a UTF-8 terminal — which is as close to "no escape key" as screen offers. The only theoretical cost is a latin-1 session where 0xFF isÿ.No version gate:
escapeand octal escapes long predate any screen still in use, and a screen that rejected the line would simply keep its default key.screen -x(the attach path) joins the running server, which keeps the setting this rc gave it at create time — same reasoning as the existingtruecolorline.Verification
Same host (GNU screen 5.0.2), same gesture, through the app:
The pane prints
[detached from 9616.mine]and returns to the wrapper's shell, with the session timer running continuously — no reconnect.cargo test --lib shell_integration: 22/22,cargo fmt --checkclean.