-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Remove startOnUserLogin
from the settings; use OS APIs only
#18530
Conversation
We could also go the other way and remove this setting from settings.json. |
This comment has been minimized.
This comment has been minimized.
might be interesting to track "by policy" for showing in ui. 🤔 |
startOnUserLogin
from the settings; use OS APIs only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! ...Lock symbol or not. 😄
…IAsyncOperation return to the calling context
…ntainer for this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Please be sure to update the docs site
} | ||
|
||
_UpdateOverrideSystem(); | ||
_UpdateHelpText(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 This line is new
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So yes! SettingContainer did not support dynamic updates to HelpText!
Before we had a Settings UI, we added support for a setting called
startOnUserLogin
. It was a boolean, and on startup we would try to yeet the value of that setting into the Windows API responsible for registering us as a startup task.Unfortunately, we failed to take into account a few things.
Users could enable our startup task outside the settings file and we would never know it. We would load up, see that
startOnUserLogin
wasfalse
, and go disable the task again. 🤦Conversely, if the user disables our task outside the app we can never enable it from inside the app. If an enterprise has configured it either direction, we can't change it either.
The best way forward is to remove it from our settings model and only ever interact with the Windows API.
This pull request replaces
startOnUserLogin
with a rich settings experience that will reflect the current and final state of the task as configured through Windows. Terminal will enable it if it can and display a message if it can't.My first attempt at this PR (which you can read in the commit history) made us try harder to sync the state between the settings model and the OS; we would propagate the disabled state back to the user setting when the task was disabled in the OS or if we failed to enable it when the user asked for it. That was fragile and didn't support reporting the state in the settings UI, and it seems like it would be confusing for a setting to silently turn itself back off anyway...
Closes #12564