fix(input): recognize PowerShell / modifyOtherKeys / Kitty Shift+Tab variants#386
Merged
fix(input): recognize PowerShell / modifyOtherKeys / Kitty Shift+Tab variants#386
Conversation
…variants (#373) Recognized only the bare xterm `\x1b[Z` back-tab. PowerShell 7.x on some Windows hosts emits the modifier-encoded `\x1b[1;2Z`; modern Windows Terminal in modifyOtherKeys mode (which we enable on startup) emits `\x1b[27;2;9~`; the Kitty keyboard envelope is `\x1b[9;2u`. None of these matched, so the edit-mode cycle was silently dropped on PowerShell. Add all three variants to `stdin-reader.ts` CSI_TAIL_MAP and to the Ink-fallback `key-normalize.ts` recovery table. `/mode` slash command remains as a typed fallback for any future terminal that emits a form we haven't seen yet.
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.
Closes #373.
Why
Reasonix only recognized the bare xterm back-tab
\x1b[Z. Windows reporters confirmed Shift+Tab does nothing on PowerShell 7.x — the edit-mode cycle silently drops because the input never matcheskey.shift && key.tab.Three other Shift+Tab encodings are common in the wild and ALL are emitted by configurations Reasonix already enables:
\x1b[1;2Z\x1b[27;2;9~\x1b[>4;2mat startup)\x1b[9;2uWhat changes
src/cli/ui/stdin-reader.ts—CSI_TAIL_MAPgains1;2Z,27;2;9~,9;2uentries (all →{ shift: true, tab: true }).src/cli/ui/key-normalize.ts—CSI_TAIL_TO_FLAGSgains the same three forms so the Ink fallback path matches whenuseInputdoesn't pre-structure them.Tests
tests/key-normalize.test.ts— 2 new cases (PowerShell variant + modifyOtherKeys / Kitty forms).tests/stdin-reader.test.ts— 2 new cases (matching round-trip through the reader).Test plan
npm run verify— 133 files / 2145 passed / 1 skipped (was 2141, +4 new)If a terminal emits a form we still don't recognize,
/modecontinues to work as a typed fallback.