fix(tui): preserve Shift+Enter in tmux csi-u panes#21943
Merged
Conversation
97281a7 to
cb9e52b
Compare
canvrno-oai
approved these changes
May 9, 2026
Contributor
canvrno-oai
left a comment
There was a problem hiding this comment.
Tested as described against the current release of codex and confirmed these changes enable shift+enter newlines in the composer when ran in tmux.
This was referenced May 10, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
Inside tmux,
Shift+Entercan still reach Codex as a plainEntereven when tmux has extended keys enabled. Incsi-utmux panes, Codex needs to requestmodifyOtherKeysmode 2 so tmux moves the pane fromVT10xinto extended-key mode and preserves the Shift modifier. Without that extra request, composerShift+Entersubmits the draft instead of inserting a newline.Fixes #21699.
What Changed
extended-keys-format, preferring the pane-local value before falling back to the global option.modifyOtherKeysmode 2 for tmux panes usingcsi-uextended keys, and reset it when restoring keyboard reporting.modifyOtherKeysescape sequence.How to Test
mode=Ext 2:tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} mode=#{pane_key_mode} cmd=#{pane_current_command}'Shift+Enter; confirm it inserts a newline instead of submitting.Enterstill submits as before.Targeted tests:
cargo test -p codex-tuiNotes
Shift+Enterin iTerm2/tmux andtmux send-keys ... S-Enterto confirm the tmux pane changes fromVT10xtoExt 2and preserves newline behavior.codex-tuitest run currently reaches unrelated existing failures instatus::tests::*plus a later stack overflow intests::fork_last_filters_latest_session_by_cwd_unless_show_all.