microsoft/Terminal

Terminal should support libtickit style input

Open

#8.719 aberto em 7 de jan. de 2021

Ver no GitHub
 (7 comments) (8 reactions) (0 assignees)C++ (3.212 forks)batch import
Area-InputHelp WantedIssue-TaskProduct-Conpty

Métricas do repositório

Stars
 (35.764 stars)
Métricas de merge de PR
 (Mesclagem média 27d 19h) (24 fundiu PRs em 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:

  • 0x7f for backspace
  • 0x08 for ctrl+backspace
  • 0x7f for shift+backspace
  • 0x7f for ctrl+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).

Guia do colaborador