SetConptyOption API (was: Ctrl-Backspace doesn't respect word delimiters even though normal cmd window does) #15523

Open
opened 2026-01-31 04:41:05 +00:00 by claunia · 8 comments
Owner

Originally created by @akshaykk on GitHub (Oct 13, 2021).

Windows Terminal version (or Windows build number)

1.10.2714.0

Other Software

cmd in a Windows Terminal profile.

Steps to reproduce

I followed the steps here (that is, I set the HKCU\Console\WordDelimiters registry key for cmd). Now if I open a regular cmd window, Ctrl-Backspace respects those word delimiters. But if I do the same in a cmd profile in Windows Terminal, it doesn't respect those delimiters. I've tried making Windows Terminal's word delimiters the same as those in that registry key, restarting Windows Terminal and restarting my machine, but it still doesn't work.

Expected Behavior

If the cursor is at the end of the following line:

C:>cd users\foo\bar

and I press Ctrl-Backspace, I expect it to delete just the word "bar".

Actual Behavior

Instead, it deletes the entire string users\foo\bar. This only happens in a cmd profile in Windows Terminal. In a normal cmd window, it only deletes the word "bar" as I expect.

Originally created by @akshaykk on GitHub (Oct 13, 2021). ### Windows Terminal version (or Windows build number) 1.10.2714.0 ### Other Software cmd in a Windows Terminal profile. ### Steps to reproduce I followed the steps [here](https://github.com/microsoft/terminal/issues/4986) (that is, I set the HKCU\Console\WordDelimiters registry key for cmd). Now if I open a regular cmd window, Ctrl-Backspace respects those word delimiters. But if I do the same in a cmd profile in Windows Terminal, it doesn't respect those delimiters. I've tried making Windows Terminal's word delimiters the same as those in that registry key, restarting Windows Terminal and restarting my machine, but it still doesn't work. ### Expected Behavior If the cursor is at the end of the following line: C:\>cd users\foo\bar and I press Ctrl-Backspace, I expect it to delete just the word "bar". ### Actual Behavior Instead, it deletes the entire string users\foo\bar. This only happens in a cmd profile in Windows Terminal. In a normal cmd window, it only deletes the word "bar" as I expect.
claunia added the Issue-FeatureArea-ServerProduct-Conpty labels 2026-01-31 04:41:05 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Oct 14, 2021):

hmmmmmmmmmmmmm this is probably due to us totally ignoring the registry settings for all conpty sessions. FWIW, did you set HKEY_CURRENT_USER\Console\WordDelimiters (the "defaults" reg key) or HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe\WordDelimiters (the reg key specific to cmd.exe windows)?

@zadjii-msft commented on GitHub (Oct 14, 2021): hmmmmmmmmmmmmm this is probably due to us totally ignoring the registry settings for all conpty sessions. FWIW, did you set `HKEY_CURRENT_USER\Console\WordDelimiters` (the "defaults" reg key) or `HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe\WordDelimiters` (the reg key specific to `cmd.exe` windows)?
Author
Owner

@akshaykk commented on GitHub (Oct 14, 2021):

Ooh, that got me excited for a minute :). I'd set the first one earlier. Following your suggestion, I set the second one too (I have both set now) but it's still not working :(. In the cmd window it works whether I set both or either one.

@akshaykk commented on GitHub (Oct 14, 2021): Ooh, that got me excited for a minute :). I'd set the first one earlier. Following your suggestion, I set the second one too (I have both set now) but it's still not working :(. In the cmd window it works whether I set both or either one.
Author
Owner

@KonoVitoDa commented on GitHub (Jul 9, 2022):

Have you find a solution?

@KonoVitoDa commented on GitHub (Jul 9, 2022): Have you find a solution?
Author
Owner

@RadAd commented on GitHub (Aug 15, 2022):

I am using Terminal version 1.14.1962.0 and this is still an issue.

This is also an issue using ctrl-left and ctrl-right. They do not respect the word delimiters either. This does work in the old conhost window.

I have tried settings word delimiters in the terminal settings and in the registry at HKEY_CURRENT_USER\Console\WordDelimiters and HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe\WordDelimiters

@RadAd commented on GitHub (Aug 15, 2022): I am using Terminal version 1.14.1962.0 and this is still an issue. This is also an issue using ctrl-left and ctrl-right. They do not respect the word delimiters either. This does work in the old conhost window. I have tried settings word delimiters in the terminal settings and in the registry at `HKEY_CURRENT_USER\Console\WordDelimiters` and `HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe\WordDelimiters`
Author
Owner

@HarjitSi commented on GitHub (Nov 10, 2022):

Just ran into Windows Terminal Version: 1.15.2875.0 with cmd.exe and with powershell.exe not respecting the word delimiters with ctrl-left and ctrl-right. Double clicking does respect the word delimeters.

@HarjitSi commented on GitHub (Nov 10, 2022): Just ran into Windows Terminal Version: 1.15.2875.0 with cmd.exe and with powershell.exe not respecting the word delimiters with ctrl-left and ctrl-right. Double clicking does respect the word delimeters.
Author
Owner

@zadjii-msft commented on GitHub (Dec 14, 2022):

Okay, so we're promoting this one as the thread. We need a better way of setting properties on the pseudoconsole. We've kinda been discussing this in the (virtual) halls for a while.

We'll have more discussion here in the future.

@zadjii-msft commented on GitHub (Dec 14, 2022): Okay, so we're promoting this one as **the thread**. We need a better way of setting properties on the pseudoconsole. We've kinda been discussing this in the (virtual) halls for a while. We'll have more discussion here in the future.
Author
Owner

@RadAd commented on GitHub (Feb 15, 2024):

Is there a public Win32 API call to set the word break characters for a console?

@RadAd commented on GitHub (Feb 15, 2024): Is there a public Win32 API call to set the word break characters for a console?
Author
Owner

@lhecker commented on GitHub (Feb 15, 2024):

No, we don't have one, since the delimiters are traditionally considered a property of the terminal/console and not of any application running within it. Applications that need customized input handling (i.e. the way vim, etc., which allows this to be customized) should for instance use a readline implementation that offers this. Users that just want to modify their selection behavior, etc., need to use the WordDelimiters registry value mentioned above.

@lhecker commented on GitHub (Feb 15, 2024): No, we don't have one, since the delimiters are traditionally considered a property of the terminal/console and not of any application running within it. Applications that need customized input handling (i.e. the way vim, etc., which allows this to be customized) should for instance use a readline implementation that offers this. Users that just want to modify their selection behavior, etc., need to use the `WordDelimiters` registry value mentioned above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15523