Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
akshaykk opened this issue Oct 12, 2021 · 8 comments
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Conpty For console issues specifically related to conpty

Comments

@akshaykk
Copy link

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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Oct 12, 2021
@zadjii-msft
Copy link
Member

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 zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Conpty For console issues specifically related to conpty labels Oct 14, 2021
@akshaykk
Copy link
Author

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.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Oct 14, 2021
@KonoVitoDa
Copy link

Have you find a solution?

@RadAd
Copy link

RadAd commented 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

@HarjitSi
Copy link

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.

@zadjii-msft zadjii-msft changed the title Ctrl-Backspace doesn't respect word delimiters even though normal cmd window does SetConptyOption API (was: Ctrl-Backspace doesn't respect word delimiters even though normal cmd window does) Dec 14, 2022
@zadjii-msft
Copy link
Member

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 zadjii-msft added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Dec 14, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 14, 2022
@zadjii-msft zadjii-msft added this to the Up Next milestone Dec 14, 2022
@RadAd
Copy link

RadAd commented Feb 15, 2024

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

@lhecker
Copy link
Member

lhecker commented 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.

@carlos-zamora carlos-zamora modified the milestones: Up Next, Terminal v1.23 Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Conpty For console issues specifically related to conpty
Projects
None yet
Development

No branches or pull requests

7 participants