Repository navigation
fix(tui): resolve Num Lock and unmapped modified keys instead of typing escape text - #35
Merged
Merged
Conversation
…ng escape text Kitty reports Num/Caps Lock as modifier bits, so Left, Shift+Enter and Ctrl+Backspace arrived as ESC[1;129D, ESC[13;130u, ESC[127;133u. Strip lock bits, fall back from Shift (Shift+Backspace acts as Backspace), map Alt+F-keys to Esc+key, and swallow remaining unbound chords. Also pin SHELL=/bin/sh in the headless timeout test, which uses POSIX $$.
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
Kitty-protocol terminals put Num/Caps Lock in the modifier field (+128 / +64), so keys missed every mapping and were typed as raw escape text.
Also: single-char matches from stripped sequences now insert the character, not the raw sequence (
normalize_xterm_shift).test_headless_timeout_kills_foreground_shellpinsSHELL=/bin/sh, since its POSIX$$is invalid in fish and the test failed for fish users.Evidence
[1;129D,[127;133u,[13;130utyped into the prompt; Shift+Backspace likewise.After: new tests send them through the real input area:
tests/test_tui_app.py,test_tui_input.py,test_tui_streaming_pty.py: 157 passed;ruff check/formatclean. Not tried in a real terminal.Merge Danger
Door: two-way
Blast Radius: TUI key input
Only sequences that previously matched nothing change behavior. Known gaps: Shift+F3 (
ESC[1;2R) still collides with the cursor-position reply; Kitty:event-typesuffixes are not handled.