-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Ctrl+Backspace indistinguishable from Backspace on Windows Terminal #2139
Copy link
Copy link
Closed
Description
What happened?
Binding deleteWordBackward to ctrl+backspace in keybindings.json has no effect on Windows Terminal. Ctrl+Backspace deletes a single character, same as plain Backspace.
Windows Terminal sends distinct bytes for each:
- Backspace:
0x7f - Ctrl+Backspace:
0x08
But both are treated as plain backspace in matchesKey() and parseKey(). So 0x08 is consumed as backspace before it can match ctrl+backspace.
Complication: 0x08 is also the ASCII code for Ctrl+H. The Emacs keybinding example uses ctrl+h for deleteCharBackward, which works because 0x08 is currently treated as backspace.
Steps to reproduce
- Add to
~/.pi/agent/keybindings.json:{ "deleteWordBackward": ["ctrl+w", "alt+backspace", "ctrl+backspace"] } - Open pi in Windows Terminal
- Type
hello world - Press Ctrl+Backspace
- Only
dis deleted, notworld
Verified with a raw stdin keyspy:
bytes: 0x7f length: 1 # Backspace
bytes: 0x08 length: 1 # Ctrl+Backspace
Expected behavior
Ctrl+Backspace should be bindable as a distinct key from Backspace on terminals where they produce different bytes.
Version
0.55.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels