Ctrl + h's behavior is differ from command prompt window #6196

Closed
opened 2026-01-31 00:32:05 +00:00 by claunia · 11 comments
Owner

Originally created by @koron on GitHub (Jan 29, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.592]
Windows Terminal version (if applicable): 0.8.10261.0

Any other software? no

Steps to reproduce

just type Ctrl + h

Expected behavior

Delete a character before the cursor, as same as command prompt window.

Actual behavior

Delete a whole word before the cursor.

Notes

I guess that this is a side effect of https://github.com/microsoft/terminal/pull/3935

Originally created by @koron on GitHub (Jan 29, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18363.592] Windows Terminal version (if applicable): 0.8.10261.0 Any other software? no ``` # Steps to reproduce just type <kbd>Ctrl + h</kbd> <!-- A description of how to trigger this bug. --> # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> Delete a character before the cursor, as same as command prompt window. # Actual behavior <!-- What's actually happening? --> Delete a whole word before the cursor. # Notes I guess that this is a side effect of https://github.com/microsoft/terminal/pull/3935
claunia added the Resolution-Duplicate label 2026-01-31 00:32:05 +00:00
Author
Owner

@koron commented on GitHub (Jan 30, 2020):

it affects vim in cmd in WindowsTerminal.

when i hit Ctrl+h in insert mode, i got Îz.

image

I expected to delete a character before the cursor.

@koron commented on GitHub (Jan 30, 2020): it affects vim in cmd in WindowsTerminal. when i hit <kbd>Ctrl+h</kbd> in insert mode, i got `Îz`. ![image](https://user-images.githubusercontent.com/468368/73423946-effdb080-4370-11ea-9da5-8952aae3cddd.png) I expected to delete a character before the cursor.
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 31, 2020):

So, this is one of those issues we might just have to live with for now. ^H means, to many other applications, the same thing as Ctrl+Backspace. To the rest of them, it means Backspace. It looks like Vim for Windows has an explicit binding for <C-H>, but now it's receiving <C-Bksp>. In Vim for LInux this works fine.

We may need to wait for /dup #879 so that Windows Vim can use raw key mode.

@DHowett-MSFT commented on GitHub (Jan 31, 2020): So, this is one of those issues we _might_ just have to live with for now. `^H` means, to many other applications, the same thing as <kbd>Ctrl+Backspace</kbd>. To the rest of them, it means <kbd>Backspace</kbd>. It looks like Vim for Windows has an explicit binding for `<C-H>`, but now it's receiving `<C-Bksp>`. In Vim for LInux this works fine. We may need to wait for /dup #879 so that Windows Vim can use raw key mode.
Author
Owner

@ghost commented on GitHub (Jan 31, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jan 31, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@moetayuko commented on GitHub (Jan 31, 2020):

@DHowett-MSFT I encountered the same issue, but don't think it's related to Vim for Windows.

Here's my result:

Setup Result
WT (wsl) + Vim Y
WT (wsl) + Vim over OpenSSH_8.1p1 Y
WT (powershell) + Vim over OpenSSH_for_Windows_7.7p1 N
WT (cmd) + Vim over OpenSSH_for_Windows_7.7p1 N
powershell.exe + Vim over OpenSSH_for_Windows_7.7p1 Y
@moetayuko commented on GitHub (Jan 31, 2020): @DHowett-MSFT I encountered the same issue, but don't think it's related to Vim for Windows. Here's my result: Setup | Result --- | --- WT (wsl) + Vim | Y WT (wsl) + Vim over OpenSSH_8.1p1 | Y WT (powershell) + Vim over OpenSSH_for_Windows_7.7p1 | __N__ WT (cmd) + Vim over OpenSSH_for_Windows_7.7p1 | __N__ powershell.exe + Vim over OpenSSH_for_Windows_7.7p1 | Y
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 31, 2020):

This is one of those weird things 😄 WT and OpenSSH_for_Windows actually use the same translation backend to talk to windows console applications, but WT uses a newer version of it. The older version was more compatible with certain windows apps, but it worked less well with everything else.

@DHowett-MSFT commented on GitHub (Jan 31, 2020): This is one of those weird things :smile: WT and OpenSSH_for_Windows actually use the same translation backend to talk to windows console applications, but WT uses a newer version of it. The older version was more compatible with certain windows apps, but it worked less well with everything else.
Author
Owner

@koron commented on GitHub (Feb 3, 2020):

this problem is introduced by #3935 .
#3935 solved only one problem which describled in #879 in wrong way.
so i think that #3935 should be reverted.

@koron commented on GitHub (Feb 3, 2020): this problem is introduced by #3935 . #3935 solved only one problem which describled in #879 in wrong way. so i think that #3935 should be reverted.
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 6, 2020):

The problem is that 3935 solved the problem described in 879 the only way that is correct for a Terminal emulator. We're right here on the boundary between what consoles and terminals need to support, and we made the call to be a terminal first.

I'm not certain that was the right decision?

@DHowett-MSFT commented on GitHub (Feb 6, 2020): The problem is that 3935 solved the problem described in 879 the only way that is correct for a Terminal emulator. We're right here on the boundary between what consoles and terminals need to support, and we made the call to be a _terminal_ first. I'm not certain that was the right decision?
Author
Owner

@debuuu commented on GitHub (Feb 9, 2020):

The bot mentioned a "referenced thread", where is that? Would like to track this, it broke some Vim muscle memory for me.

@debuuu commented on GitHub (Feb 9, 2020): The bot mentioned a "referenced thread", where is that? Would like to track this, it broke some Vim muscle memory for me.
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 14, 2020):

Sorry @debuuu - it's referring to #879

@DHowett-MSFT commented on GitHub (Feb 14, 2020): Sorry @debuuu - it's referring to #879
Author
Owner

@koron commented on GitHub (Feb 14, 2020):

the problem is that the terminal generate same codes 0x08 for ctrl+h and ctrl+backspace.
but #3935 resolved it by parsing the code (0x08) as ctrl+backspace always.

i don't think this is correct way to fix.

@koron commented on GitHub (Feb 14, 2020): the problem is that the terminal generate same codes `0x08` for <kbd>ctrl+h</kbd> and <kbd>ctrl+backspace</kbd>. but #3935 resolved it by parsing the code (`0x08`) as <kbd>ctrl+backspace</kbd> always. i don't think this is correct way to fix.
Author
Owner

@wmertens commented on GitHub (Apr 3, 2020):

I'm probably re-hashing old conversations, sorry, it's hard to read all threads on GitHub.

How about sending esc+ctrl-h? That seems to always work in the shells I came across?

@wmertens commented on GitHub (Apr 3, 2020): I'm probably re-hashing old conversations, sorry, it's hard to read all threads on GitHub. How about sending esc+ctrl-h? That seems to always work in the shells I came across?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6196