Open umnyaga opened 1 year ago
What keyboard layout are you using? I'm betting there's an encoding glitch where we're treating the Bksp as Ctrl+Bksp for some reason.
I use HP C3758A and another Lenovo standard, do not know the model number, but it is simple one without any fanciness. Both standard US layout. These two keyboards belong to most standard ones as it gets.
Hmm #13894
Hmm, interesting. I've never tried, but Ctrl-Backspace deletes character left.
Our leading theory is that this is being caused by referencing uninitialized memory. That should be fixed via https://github.com/microsoft/terminal/pull/14345. So we'll hope that fixes this, and circle back around after it's merged.
@umnyaga can you try out v1.15.3465.0 / v1.15.3466. (or the latest 1.16 build), and see if that fixes this/?
@umnyaga can you try out v1.15.3465.0 / v1.15.3466. (or the latest 1.16 build), and see if that fixes this/?
@zadjii-msft just tried, there is no changes in behavior, backspace still deletes a word left.
Huh. The assumption here is that DECBKM
is defaulting to on for you, but there's pretty much no reason that should be. There would need to be some sort of \x1b[?67h
in your profile.ps1
or something, but then I wouldn't expect this to repro in CMD as well.
I wonder if we could test that... I don't think pwsh uses VT for input events at all, so that's not
Wait a second, neither CMD nor pwsh would be using VT input. So this shouldn't be that at all. It's like there's something else swapping Bkspc and DEL
Can you try repro'ing this with the debug tap to get a trace of all the input and output? Once the bug starts occurring, send us a screenshot and we might be able to figure out what the Terminal thinks it's getting here.
@zadjii-msft FYI, you can kind of trick the terminal into enabling DECBKM
by exploiting the way we pass through modes that aren't recognised. However, that requires the Win32 input mode is disabled as well. For example, in PowerShell you'd need to do something like this:
echo "`e[?9001;9999l"
echo "`e[?67;9999h"
I wouldn't have thought it likely that anyone is doing that accidentally, though. But if DECBKM
is to blame, you ought to be able to "fix" it with something like this:
echo "`e[?67;9999l"
Can you try repro'ing this with the debug tap to get a trace of all the input and output? Once the bug starts occurring, send us a screenshot and we might be able to figure out what the Terminal thinks it's getting here.
Here is what I've got
That's really weird. It appears that the backspace key is somehow bypassing the Win32 input mode encoding. We should be seeing keydown and keyup events for a VK_BACK
key, (i.e. ␛[8;14;8;1;32;1_
␛[8;14;8;0;32;1_
), but instead we're getting a single ␈
character. I have no idea how that could happen.
Wow, uh, me neither. Maybe it's coming through on the... character handler, instead of the key one? This is super bizarre. Turning off win32 input probably wouldn't fix this either, then, cause the event would still get sent as a BS char, which would still get translated wrong.
@zadjii-msft FYI, you can kind of trick the terminal into enabling
DECBKM
by exploiting the way we pass through modes that aren't recognised. However, that requires the Win32 input mode is disabled as well. For example, in PowerShell you'd need to do something like this:echo "`e[?9001;9999l" echo "`e[?67;9999h"
I wouldn't have thought it likely that anyone is doing that accidentally, though. But if
DECBKM
is to blame, you ought to be able to "fix" it with something like this:echo "`e[?67;9999l"
This fixed it for me, thank you!
This is still an intermittent issue in cmd in the latest version (1.20.11781.0) and the ^[[?67;9999l
fix does not help it.
Windows Terminal version
1.15.2874.0, 1.16.2641.0
Windows build number
10.0.19043.0
Other Software
No response
Steps to reproduce
type several word in shell command line and press backspace.
Expected Behavior
Backspace deletes character left unstead od whole words
Actual Behavior
In Power Shell or Cmd running in Windows Terminal, pressing backspace deletes whole word left instead of character left. It's interesting, once ssh to remote linux host from that powershell window, backspace behavior becomes normal. I found it on my home PC and on at workplace's PC.