Skip to content

fix: detect Ctrl+Q in enhanced keyboard protocol encodings#357

Closed
PatrickStraeter wants to merge 1 commit intoasheshgoplani:mainfrom
PatrickStraeter:fix/ctrl-q-enhanced-keyboard-protocols
Closed

fix: detect Ctrl+Q in enhanced keyboard protocol encodings#357
PatrickStraeter wants to merge 1 commit intoasheshgoplani:mainfrom
PatrickStraeter:fix/ctrl-q-enhanced-keyboard-protocols

Conversation

@PatrickStraeter
Copy link
Copy Markdown
Contributor

Modern terminals with kitty keyboard protocol or xterm modifyOtherKeys encode Ctrl+Q as escape sequences (ESC[113;5u or ESC[27;5;113~) instead of raw byte 0x11. This broke detach in local sessions after the inner process enabled enhanced reporting, and in SSH remote sessions.

Extract IndexCtrlQ into a shared function in internal/tmux that handles all three encodings, and use it in both the local PTY attach and SSH attach paths.

Modern terminals with kitty keyboard protocol or xterm modifyOtherKeys
encode Ctrl+Q as escape sequences (ESC[113;5u or ESC[27;5;113~) instead
of raw byte 0x11. This broke detach in local sessions after the inner
process enabled enhanced reporting, and in SSH remote sessions.

Extract IndexCtrlQ into a shared function in internal/tmux that handles
all three encodings, and use it in both the local PTY attach and SSH
attach paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
asheshgoplani added a commit that referenced this pull request Mar 18, 2026
@asheshgoplani
Copy link
Copy Markdown
Owner

Merged to main with added unit tests for IndexCtrlQ (9 test cases covering raw byte, xterm modifyOtherKeys, and kitty keyboard protocol encodings). Thank you!

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.

2 participants