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

Windows changing "Default Terminal Application" automatically without asking. #15654

Closed
adithya-s-sekhar opened this issue Jul 4, 2023 · 11 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@adithya-s-sekhar
Copy link

Windows Terminal version

1.17.11461.0

Windows build number

10.0.22621.1848

Other Software

No response

Steps to reproduce

Change the Default Terminal Application in Windows terminal settings to Windows Console Host because Terminal does not support basic features from conhost yet. All my scripts are breaking and is affecting my personal and professional life.

Expected Behavior

The settings will stay unless the user changed it.

Actual Behavior

Continuing to use the computer normally and without even updating windows, without even restarting, Terminal reset the Default terminal application value to Let Windows decide.

@adithya-s-sekhar adithya-s-sekhar added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 4, 2023
@lhecker
Copy link
Member

lhecker commented Jul 5, 2023

Did you click the "Save" button after changing the default terminal?

@lhecker lhecker added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 5, 2023
@adithya-s-sekhar
Copy link
Author

Did you click the "Save" button after changing the default terminal?

Let me explain the timeline. Yes. I changed and saved it almost a month ago. It's been running in console host all this time.
Yesterday I opened my script it was still running in console host. Then I closed it.

But when I opened it again after a few minutes, it opened in Terminal. I was stumped and I immediately checked the settings, sure enough it defaulted to Let Windows decide.

There were no updates, no restarts, I didn't have anything else running. It was running in console host a few minutes ago and now it opened in Terminal.

@microsoft-github-policy-service microsoft-github-policy-service bot 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 Jul 5, 2023
@DHowett
Copy link
Member

DHowett commented Jul 5, 2023

The settings will stay unless the user changed it.

Hmm. We've made no changes to overwrite any user preferences here. However, if Windows detects that the terminal it should be launching no longer exists (like, it was uninstalled or the registration was damaged,) it will default to Let Windows Decide.

The registry entries in HKCU\Console\%%Startup are only modified when you Save in Terminal or dismiss the console properties dialog by pressing OK.

This is quite strange!

@adithya-s-sekhar
Copy link
Author

Indeed it is. So far this has happened on only one laptop. It is possible it got corrupted in someway. It's just strange when it was working fine just a couple of minutes ago.

@zadjii-msft
Copy link
Member

I wonder if there's any way for you to run some sort of script that would listen for reg key writes, to try and find out what process is changing the HKCU\Console\%%Startup values. If you haven't hit "Save" (in the terminal), or "Ok" (in the console properties), then I don't think there's anything else that would reset that.

Unless there's something with dynamic profiles deciding to write out the settings file (and writing the defterm setting additionally). But that would also imply that the Terminal determined that the selected "default terminal app" still didn't exist, and reset it to "let windows decide".

What's the output of reg query HKCU\Console\%%Startup before and after this bug occurs/? Maybe there's a bad value in there that we're incorrectly believing is "an uninstalled app", instead of conhost.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 5, 2023
@adithya-s-sekhar
Copy link
Author

adithya-s-sekhar commented Jul 5, 2023

I have since changed it back to console host and it has stayed that way till now. It hasn't happened again yet.
I wanted to know if this was something intentional by Microsoft or if there are plans to replace conhost entirely and replace with terminal.

This is the output of that command now

HKEY_CURRENT_USER\Console\%%Startup
    DelegationConsole    REG_SZ    {B23D10C0-E52E-411E-9D5B-C09FDF709C7D}
    DelegationTerminal    REG_SZ    {B23D10C0-E52E-411E-9D5B-C09FDF709C7D}

So far it has only happened once, but I was worried if this was intentional, terminal does not have some old features conhost have.

@microsoft-github-policy-service microsoft-github-policy-service bot 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 Jul 5, 2023
@carlos-zamora
Copy link
Member

Hi @adithya-s-sekhar. Sorry, this isn't intentional. We plan on continuing to ship conhost in-box with windows, however. Additionally, if there are specific features you are missing from the console host that you'd like to see in Windows Terminal, we'd love to hear back from you.

@carlos-zamora carlos-zamora closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
@zadjii-msft
Copy link
Member

(if you do see this happen again, I'd love to see what it got changed to! This is certainly curious, but without a way to really repro this on demand, I'm not sure how to investigate more)

@adithya-s-sekhar
Copy link
Author

Additionally, if there are specific features you are missing from the console host that you'd like to see in Windows Terminal, we'd love to hear back from you.

The important feature for a lot of us is the ability to change window size and buffer. We can't currently change these on Terminal. A lot of scripts and command line programs use it, there were multiple issues about it already. They were all marked as duplicates of #5094.

#4062, #5079, #5651, #5753, #2630, #6392, #40, #6832, #7082, #7232, #7466, #7623, #7605, #8581, #8673, #9113, #11033, #12929, #13232, #13392, #13375, #13441, #13564, #13006, #13911, #13940, #14487, #14568, #14622, #15297 (I had these saved in a note some time ago.)

Since it's already clear Terminal is not going to support it, we are hoping console host would stay as an option for us. Glad to hear it will be .

(if you do see this happen again, I'd love to see what it got changed to! This is certainly curious, but without a way to really repro this on demand, I'm not sure how to investigate more)

Curious about that as well :) hopefully it was a one time thing, corrupted entries maybe.

@zadjii-msft
Copy link
Member

Since it's already clear Terminal is not going to support it

Well, that's not really true now. We've got bits of a plan to have Terminal support this at least in a limited fashion (when there's only a single pane). Just need some time to do the engineering work (or for someone to help contribute the fix 😉)

@NRJank
Copy link

NRJank commented Apr 12, 2024

While messing around on Windows 10 I came across an 'automatic' reset of the Let Windows Decide setting. I don't know if this relates to what triggered the initial report. Tested on Win10 21H2 and 22H2 (the latter with or without Windows Terminal installed). Don't have a Win11 system to test on. I have a console-using application with a Desktop shortcut. Right clicking the shortcut and selecting Properties shows a Properties dialog with all of the Console specific tabs. The Options tab has the option 'Use legacy console'. To reproduce:

1 - open Settings/developers and set default terminal option to Windows Console Host.
2 - close the settings window (reopening and checking verifies it has stayed 'set')
3 - Access the Properties menu by right clicking on the shortcut
4 - Navigate to Options, and toggle (either select or deselect) the use Legacy console option.
5 - close the Properties dialog.
6 - reopen developer Settings. Note that terminal option has been reset to Let Windows Decide.

Repeated this on systems with and without Windows Terminal installed. On windows 10 it seems 'let windows decide' still reverts to conhost.exe. If this also happens on win11, I believe it's expected to chose Windows Terminal. So it seems this could cause users to have their expected terminal switched unknowingly. Note that if I go to the properties menu within the open application to set the Legacy property, this change does not happen. I don't know what's different about accessing the properties from a shortcut vs from within an open application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

6 participants