fix(tui): preserve Ctrl+J newline across extended keys and tmux - #88957
Open
valda wants to merge 3 commits into
Open
fix(tui): preserve Ctrl+J newline across extended keys and tmux#88957valda wants to merge 3 commits into
valda wants to merge 3 commits into
Conversation
Contributor
Right fix for a real regression class: extended-key protocols report Ctrl+J as a modified printable (
No blocking issues found. |
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
Ctrl+Jevents from Kitty CSI-u / modifyOtherKeys as a composer newlineCtrl+Junder tmux when extended keys are disabledCR) as submit and leave extra-modifier chords untouchedRoot cause
Extended-key protocols report
Ctrl+Jasinput = "j"withctrl = true, not as a Return/LF event. The composer had no binding for that normalized form, so it inserted a literalj.With tmux
extended-keys=off,Ctrl+Jinstead collapses to bare LF.shouldPreserveCtrlJNewline()did not recognize tmux, so that LF followed the submit path.This is separate from #51546, which only adds VTE detection for bare LF, and from the classic CLI fixes in #32860 / #75473.
Behavior
Ctrl+J: insert newlineCtrl+J: insert newlineCR): submitCtrl+Shift+Jand other extra-modifier chords: unchangedTesting
npm test --workspace ui-tui -- --run src/__tests__/textInputReturnAction.test.ts src/__tests__/textInputPassThrough.test.ts(16 passed, including parsed CSI-u and modifyOtherKeys wire forms)npm run typecheck --workspace ui-tuinpm run lint --workspace ui-tui(0 errors; 2 pre-existing warnings)npx prettier --check ui-tui/src/components/textInput.tsx ui-tui/src/__tests__/textInputReturnAction.test.tsnpm run build --workspace ui-tuigit diff --check upstream/main...HEADDogfood
Verified on Alacritty 0.16.1 both directly and under tmux 3.7b (
extended-keys=off):Ctrl+Jinserts a newline,Shift+Returninserts a newline, and normal Return still submits.