fix(tmux): only enable extended-keys when outer terminal supports CSI u#418
Merged
asheshgoplani merged 1 commit intoasheshgoplani:mainfrom Mar 26, 2026
Conversation
agent-deck unconditionally sets `extended-keys on` and appends `extkeys` to `terminal-features` on every session create/restart. This breaks Shift+key combos (Shift+R, Shift+D, etc.) in terminal emulators that don't support the CSI u / kitty keyboard protocol, because tmux encodes modified keys as CSI sequences that the terminal silently drops. Add `outerTerminalSupportsExtKeys()` that checks TERM and TERM_PROGRAM to detect terminals known to support the protocol (Ghostty, kitty, WezTerm). Notably, cmux sets TERM=xterm-ghostty but does not support CSI u, so we check TERM_PROGRAM to distinguish real Ghostty from cmux. Default to off — breaking Shift+key input is worse than missing extended key reports for the majority of users. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Steven17D
pushed a commit
to Steven17D/agent-deck
that referenced
this pull request
Mar 25, 2026
4 tasks
Steven17D
pushed a commit
to Steven17D/agent-deck
that referenced
this pull request
Mar 28, 2026
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
Fixes #417
agent-deck unconditionally enables tmux
extended-keys on, which breaks Shift+key combos in terminals that don't support the CSI u / kitty keyboard protocol (cmux, Alacritty, Terminal.app, etc.).outerTerminalSupportsExtKeys()that checksTERMandTERM_PROGRAMto detect CSI u-capable terminals (Ghostty, kitty, WezTerm)TERM=xterm-ghosttywithout supporting CSI u — we checkTERM_PROGRAMto distinguish real Ghosttyextended-keys onand appendextkeystoterminal-featureswhen the outer terminal supports itStartandStartQuick)Test plan
TestOuterTerminalSupportsExtKeys— 14 cases covering Ghostty, cmux-as-ghostty, kitty, WezTerm, plain xterm, tmux, screen, unknown terminals, and TERM_PROGRAM-only detectiongo build ./...)🤖 Generated with Claude Code