Skip to content

Send ESC DEL for Alt+Backspace and BS for Ctrl+Backspace - #167

Open
alexeyzimarev wants to merge 1 commit into
tomlm:mainfrom
alexeyzimarev:alexeyzimarev/backspace-modifiers
Open

alexeyzimarev wants to merge 1 commit into
tomlm:mainfrom
alexeyzimarev:alexeyzimarev/backspace-modifiers

Conversation

@alexeyzimarev

Copy link
Copy Markdown

Fixes #166.

KeyboardInputGenerator mapped Key.Backspace to DEL whatever the modifiers, so a shell deleted one character for Alt+Backspace and could not tell Ctrl+Backspace from a plain one. This mirrors the xterm.js rule (Keyboard.ts, case 8): ^H when Ctrl is held, DEL otherwise, and an ESC prefix when Alt is held.

Call Before After
Backspace, Alt \x7f \x1b\x7f
Backspace, Control \x7f \x08
Backspace, Control + Alt \x7f \x1b\x08

Only the legacy path changes; the kitty encoding of the same chords was already correct. Two tests added in KeyboardInputTests; the whole suite passes.

The legacy generator mapped Backspace to DEL whatever the modifiers, so a shell deleted one character for Alt+Backspace. Mirrors xterm.js Keyboard.ts, case 8.
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.

Legacy Backspace drops Alt and Ctrl: ESC DEL and ^H are never sent

1 participant