terminal icon indicating copy to clipboard operation
terminal copied to clipboard

sendInput sending no input on `\u001b\u007f`

Open nebula-it opened this issue 1 year ago • 5 comments

Windows Terminal version

1.19.10573.0

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

Define actions using:

        {
            "command": 
            {
                // This send Alt + Backspace which deletes the last word.
                // However on powershell in windows this is binded to `ShellBackwardKillWord` 
                // which deletes full word without caring about delimiters
                // Can be fixed using Set-PSReadLineKeyHandler -Function BackwardKillWord -Key Alt+Backspace

                "action": "sendInput",
                "input": "\u001b\u007f"
            },
            "keys": "ctrl+backspace"
        },

In a linux shell (WSL or over SSH), run showkey -a, no input is received when pressing Ctrl+Backspace.

Expected Behavior

Output of showkey -a should show something like below when pressing Ctrl+Backspace.

 27 0033 0x1b
  8 0010 0x7f

Actual Behavior

Output of showkey -a is empty when pressing Ctrl+Backspace.

### Tasks

nebula-it avatar Mar 18 '24 05:03 nebula-it

Weird. It's almost as if all the... ctrl chars after the last esc get trimmed? what the heck? That's so weird.

zadjii-msft avatar May 01 '24 21:05 zadjii-msft

Yeap it is, AFAIK it was working fine in previous versions. Not 100% sure if it was in 1.18 but definitely was working in 1.17. Let me know if I can help with any logs etc

nebula-it avatar May 01 '24 21:05 nebula-it

        { "command":{ "action": "sendInput", "input": "\\x1b" } },
        { "command":{ "action": "sendInput", "input": "\u001b" } },
        { "command":{ "action": "sendInput", "input": "\u001b[A" } },
        { "command":{ "action": "sendInput", "input": "\u001b[" } },
        { "command":{ "action": "sendInput", "input": "\u001b[\u001b" } },
        { "command":{ "action": "sendInput", "input": "\u001b " } },
        { "command":{ "action": "sendInput", "input": "A\u001b" } },
        { "command":{ "action": "sendInput", "input": "A\u007f" } },
        { "command":{ "action": "sendInput", "input": "A\u001b\u007f" } },
        { "command":{ "action": "sendInput", "input": "\u001b\u007f" } },
        { "command":{ "action": "sendInput", "input": "\u001b\u007f\u001b\u007f" } },

sharing other stuff i tested from one pc to the other

zadjii avatar May 01 '24 21:05 zadjii

Hey @zadjii, Any updates here?

nebula-it avatar May 30 '24 20:05 nebula-it

Nope. Haven't had a chance to loop back on it since Build.

zadjii-msft avatar May 30 '24 22:05 zadjii-msft