microsoft / microsoft/terminal
Terminal should support libtickit style input
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior in WSL Ubuntu 20.04 with showkey -a, testing backspace with the listed modifier combinations. Compare the emitted sequences with the VT input mappings shown in ~/.inputrc; done means the terminal emits distinct sequences for modified backspace presses while retaining ordinary backspace behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, cpp
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100