We shouldn't have our own startup setting, we should just use the OS one #16857

Closed
opened 2026-01-31 05:25:15 +00:00 by claunia · 3 comments
Owner

Originally created by @zadjii-msft on GitHub (Feb 24, 2022).

From MSFT:34529127

Steps to repro:

  1. Open Settings - App - Start up.
  2. Enable start up setting for Windows Terminal.
  3. Reboot.

Expected results:
Windows Terminal can launch automatically after enter desktop and App start up setting should be on for Windows Terminal.
Actual results:
Windows Terminal can launch automatically after enter desktop, but App start up setting become off for Windows Terminal.


More notes, circa Dec 2023:

Okay so we all re-read all the docs and I think we were wrong entirely here.

We should have never had this setting in our settings JSON in the first place. It should have always just been backed by the OS setting. This probably dates back to us just having a JSON settings file. We should make the settings in the Terminal Settings UI reflect the OS settings. We shouldn't maintain our own separate setting.

We need the Windows Settings Startup being Enabled to trigger Windows to start Terminal on next reboot.
And, we need the Terminal Settings Startup to be Enabled, to keep it in the Enabled state for Windows. If this is not enabled, when Windows launches Terminal after reboot, Terminal app itself disables the startup task here: 306f31acf4/src/cascadia/TerminalApp/AppLogic.cpp (L382)

Quickly glancing through the Terminal code, Terminal Settings Startup relies on "startOnUserLogin" value and is saved in a default file. This value does not change if the user changes startup state in Windows Settings.

I am not sure, why the startup task is disabled when StartupTaskState::Enabled in the above link. But in my opinion it shouldn't be disabled if the user has enabled it in Windows settings. and use the value returned by StartupTask::GetAsync(StartupTaskName) for "startOnUserLogin".

Note

Walkthrough

I need to write a new one!

We need to:

  • Ditch the old setting entirely.
  • Make the toggle in the Settings tab reflect the OS setting
  • probably remove Enabled="false" from our manidest, ala #16244
Originally created by @zadjii-msft on GitHub (Feb 24, 2022). From MSFT:34529127 > Steps to repro: > 1. Open Settings - App - Start up. > 2. Enable start up setting for Windows Terminal. > 3. Reboot. > > Expected results: > Windows Terminal can launch automatically after enter desktop and App start up setting should be on for Windows Terminal. > Actual results: > Windows Terminal can launch automatically after enter desktop, but App start up setting become off for Windows Terminal. ---- More notes, circa Dec 2023: Okay so we all re-read all the docs and I think we were wrong entirely here. We should have never had this setting in our settings JSON in the first place. It should have always just been backed by the OS setting. This probably dates back to us just having a JSON settings file. We should make the settings in the Terminal Settings UI reflect the OS settings. We shouldn't maintain our own _separate_ setting. > We need the Windows Settings Startup being Enabled to trigger Windows to start Terminal on next reboot. And, we need the Terminal Settings Startup to be Enabled, to keep it in the Enabled state for Windows. If this is not enabled, when Windows launches Terminal after reboot, Terminal app itself disables the startup task here: https://github.com/microsoft/terminal/blob/306f31acf482ce84701aabee52981575277f16bb/src/cascadia/TerminalApp/AppLogic.cpp#L382 > > Quickly glancing through the Terminal code, Terminal Settings Startup relies on "`startOnUserLogin`" value and is saved in a default file. This value does not change if the user changes startup state in Windows Settings. > > I am not sure, why the startup task is disabled when `StartupTaskState::Enabled` in the above link. But in my opinion it shouldn't be disabled if the user has enabled it in Windows settings. and use the value returned by `StartupTask::GetAsync(StartupTaskName)` for "`startOnUserLogin`". > [!Note] > ## Walkthrough I need to write a new one! We need to: * Ditch the old setting entirely. * Make the toggle in the Settings tab reflect the OS setting * probably remove `Enabled="false"` from our manidest, ala #16244
Author
Owner

@Griffin641498 commented on GitHub (Sep 22, 2023):

From MSFT:34529127

Steps to repro:

  1. Open Settings - App - Start up.
  2. Enable start up setting for Windows Terminal.
  3. Reboot.

Expected results:
Windows Terminal can launch automatically after enter desktop and App start up setting should be on for Windows Terminal.
Actual results:
Windows Terminal can launch automatically after enter desktop, but App start up setting become off for Windows Terminal.

Note

Walkthrough

        <uap5:Extension Category="windows.startupTask">
          <uap5:StartupTask
            TaskId="StartTerminalOnLoginTask"
            Enabled="false"
            DisplayName="ms-resource:AppName" />
        </uap5:Extension>

That apparently can just be unset like:

        <uap5:Extension Category="windows.startupTask">
          <uap5:StartupTask
            TaskId="StartTerminalOnLoginTask"
            DisplayName="ms-resource:AppName" />
        </uap5:Extension>
@Griffin641498 commented on GitHub (Sep 22, 2023): > From MSFT:34529127 > > > > > Steps to repro: > > 1. Open Settings - App - Start up. > > 2. Enable start up setting for Windows Terminal. > > 3. Reboot. > > > > Expected results: > > Windows Terminal can launch automatically after enter desktop and App start up setting should be on for Windows Terminal. > > Actual results: > > Windows Terminal can launch automatically after enter desktop, but App start up setting become off for Windows Terminal. > > > **Note** > > ## Walkthrough > > ```xml > <uap5:Extension Category="windows.startupTask"> > <uap5:StartupTask > TaskId="StartTerminalOnLoginTask" > Enabled="false" > DisplayName="ms-resource:AppName" /> > </uap5:Extension> > ``` > > That apparently can just be unset like: > > ```xml > <uap5:Extension Category="windows.startupTask"> > <uap5:StartupTask > TaskId="StartTerminalOnLoginTask" > DisplayName="ms-resource:AppName" /> > </uap5:Extension> > ```
Author
Owner

@Harsh-Avinash commented on GitHub (Oct 18, 2023):

I would love to take this up!

@Harsh-Avinash commented on GitHub (Oct 18, 2023): I would love to take this up!
Author
Owner

@zadjii-msft commented on GitHub (Oct 18, 2023):

@Harsh-Avinash Go for it! Lemme know if you need any help ☺️

@zadjii-msft commented on GitHub (Oct 18, 2023): @Harsh-Avinash Go for it! Lemme know if you need any help ☺️
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16857