Skip to content

fix: handle all modifier combinations and Home/End in modified key parsing#68

Open
milanmitrovic wants to merge 1 commit into
Norbert515:mainfrom
milanmitrovic:fix/modifier-key-parsing
Open

fix: handle all modifier combinations and Home/End in modified key parsing#68
milanmitrovic wants to merge 1 commit into
Norbert515:mainfrom
milanmitrovic:fix/modifier-key-parsing

Conversation

@milanmitrovic
Copy link
Copy Markdown

@milanmitrovic milanmitrovic commented Apr 6, 2026

Summary

  • The xterm modified key parser (ESC[1;{mod}X) only handled Shift(2), Alt(3), and Ctrl(5) with arrow keys
  • Modifier combinations (Ctrl+Shift, Ctrl+Alt, Alt+Shift, etc.) and modified Home/End keys were silently consumed as unrecognized sequences
  • Reuses the existing _decodeModifiers bitmask decoder to handle all modifier values, and adds Home (0x48) and End (0x46) to the key map
  • Applied to both InputParser and KeyboardParser
  • Net -144 lines by collapsing three nearly-identical switch blocks into one generic handler

Test plan

  • All 1253 existing tests pass
  • dart analyze clean on both modified files
  • Manual verification of Shift+Home, Ctrl+End, Ctrl+Shift+Arrow in a terminal app

🤖 Generated with Claude Code

…rsing

The xterm modified key parser only handled Shift(2), Alt(3), and Ctrl(5)
with arrow keys. Modifier combinations (Ctrl+Shift, Ctrl+Alt, etc.) and
modified Home/End keys fell through to the unrecognized-sequence handler
and were silently dropped.

Reuse the existing _decodeModifiers bitmask decoder to handle all
modifier values, and add Home (0x48) and End (0x46) to the key map.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant