Area-InputHelp WantedIssue-TaskProduct-Conpty
Repository metrics
- Stars
- (35,764 stars)
- PR merge metrics
- (Avg merge 27d 19h) (24 merged PRs in 30d)
Description
Environment
Windows build number: 10.0.19042.0
Windows Terminal version (if applicable): 1.4.3243.0
WSL: ubuntu 20.04, with bash 5.0.17
Steps to reproduce
Open a new tab with a shell from ubuntu 20.04, run showkey -a, then hit backspace, then shift+backspace etc, WT sends:
0x7fforbackspace0x08forctrl+backspace0x7fforshift+backspace0x7fforctrl+shift+backspace
(hit ctrl+d to end the showkey -a session)
Expected behavior
Expecting to be able to distinguish modifier + backspace key presses.
I like to make it so that ctrl+backspace deletes previous word, and ctrl+shift+backspace deletes everything preceding the cursor. I do so via ~/.inputrc, which works on most VT terminals:
"\e[127;5u": backward-kill-word # ctrl+backspace
"\e[127;6u": backward-kill-line # ctrl+shift+backspace
"\e[3;5~": kill-word # ctrl+delete
"\e[3;6~": kill-line # ctrl+shift+delete
I was able to make it work easily by adding this to my settings.json in WT:
{ "command": {"action": "sendInput", "input": "\u001b[127;2u" }, "keys": "shift+backspace" },
{ "command": {"action": "sendInput", "input": "\u001b[127;5u" }, "keys": "ctrl+backspace" },
{ "command": {"action": "sendInput", "input": "\u001b[127;6u" }, "keys": "ctrl+shift+backspace" },
Actual behavior
WT does not seem to distinguish modifier + backspace key presses (at least not in WSL).