Skip to content

Terminal should support libtickit style input #8719

@zsimic

Description

@zsimic

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-InputRelated to input processing (key presses, mouse, etc.)Help WantedWe encourage anyone to jump in on these.Issue-TaskIt's a feature request, but it doesn't really need a major design.Product-ConptyFor console issues specifically related to conpty

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions