-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Labels
Area-InputRelated to input processing (key presses, mouse, etc.)Related to input processing (key presses, mouse, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsPriority-2A description (P2)A description (P2)Product-ConptyFor console issues specifically related to conptyFor console issues specifically related to conpty
Milestone
Description
Environment
Windows:
Platform ServicePack Version VersionString
-------- ----------- ------- -------------
Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0
Vim.exe: 8.2.701
Steps to reproduce
- start "cmd.exe" in windows terminal.
- run vim.exe (https://github.com/vim/vim-win32-installer/releases)
- input "iaaaaaaa" to enter insert mode and append some characters.
- press "CTRL+h" several times
Expected behavior
The previous "aaaaa" should get deleted (CTRL+H in vim's insert mode will delete previous character), just like running vim.exe in the traditional cmd.exe window.
Actual behavior
"CTRL+h" inserts some strange characters: "ÎzÎzÎzÎzÎzÎzÎz"
after some inspection, I located the difference, if I use getch in msvcrt.dll to display keycode:
- Run cmd.exe directly:
D:\>python -c "import msvcrt;print(msvcrt.getch())"
b'\x08' <--- press CTRL+H
D:\>python -c "import msvcrt;print(msvcrt.getch())"
b'\x08' <--- press BackSpace
Both "CTRL+H" and "BackSpace" are b'\x08', vim.exe works fine with it .
- Run cmd.exe in Windows Terminal:
D:\>python -c "import msvcrt;print(msvcrt.getch())"
b'\x7f' <--- press CTRL+H
D:\>python -c "import msvcrt;print(msvcrt.getch())"
b'\x08' <--- press BackSpace
Now, "CTRL+H" becomes b'\x7f' in Windows Terminal, which is different from running cmd.exe directly without windows terminal, and that difference breaks some terminal softwares like vim.exe .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-InputRelated to input processing (key presses, mouse, etc.)Related to input processing (key presses, mouse, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsPriority-2A description (P2)A description (P2)Product-ConptyFor console issues specifically related to conptyFor console issues specifically related to conpty
