[PR #18530] Remove startOnUserLogin from the settings; use OS APIs only #31555

Open
opened 2026-01-31 09:47:59 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/18530

State: closed
Merged: Yes


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.

  • Startup tasks can be independently controlled by the user in Windows Settings or by an enterprise using enterprise policy
  • This control is not limited to disabling the task; it also supports enabling it!

Users could enable our startup task outside the settings file and we would never know it. We would load up, see that startOnUserLogin was false, 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

**Original Pull Request:** https://github.com/microsoft/terminal/pull/18530 **State:** closed **Merged:** Yes --- 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. - Startup tasks can be independently controlled by the user in Windows Settings or by an enterprise using enterprise policy - This control is not limited to *disabling* the task; it also supports enabling it! Users could enable our startup task outside the settings file and we would never know it. We would load up, see that `startOnUserLogin` was `false`, and go disable the task again. :facepalm: 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
claunia added the pull-request label 2026-01-31 09:47:59 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31555