terminal
terminal copied to clipboard
Legacy mode + shortcut propsheet may reset Default Terminal setting
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.
Originally posted by @NRJank in https://github.com/microsoft/terminal/issues/15654#issuecomment-2051995221
@nrjank thanks so much for writing this up! I promoted it to a separate bug. The interaction between our new settings, legacy mode, and shortcuts is a place that deserves to be better-explored
This isn't the culprit, defterm settings aren't saved there: https://github.com/microsoft/terminal/blob/5f3a857192b2fa6f4e5ae87eb3ee59a1571515a2/src/propsheet/registry.cpp#L949-L954
Here we get them into the propsheet https://github.com/microsoft/terminal/blob/5f3a857192b2fa6f4e5ae87eb3ee59a1571515a2/src/propsheet/console.cpp#L618-L622
and here we set it: https://github.com/microsoft/terminal/blob/5f3a857192b2fa6f4e5ae87eb3ee59a1571515a2/src/propsheet/console.cpp#L99
This may be related to how I changed the meaning of the all-zero GUID from "Windows Console Host" to "Let Windows decide".