Allow a separate launch mode for when Terminal automatically starts on login #18065

Open
opened 2026-01-31 06:02:45 +00:00 by claunia · 4 comments
Owner

Originally created by @DHowett on GitHub (Jul 29, 2022).

Ported from MSFT-40653626

It would be nice if we could do these two things:

  1. Have a separate launch mode for when Terminal is started on login by our start on login setting.
  2. Once we have that, add support for launching minimized. This would let people specify that on startup, Terminal should launch minimized... but it should launch normally otherwise.
Originally created by @DHowett on GitHub (Jul 29, 2022). _Ported from MSFT-40653626_ It would be nice if we could do these two things: 1. Have a separate launch mode for when Terminal is started on login by our start on login setting. 2. Once we have that, add support for launching _minimized_. This would let people specify that on startup, Terminal should launch minimized... but it should launch normally otherwise.
claunia added the Issue-FeatureArea-SettingsProduct-TerminalArea-UserInterface labels 2026-01-31 06:02:45 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Aug 1, 2022):

I feel like we've discussed this before on this repo. I bet I linked it to #9992, but I could see this as something separate, tbh.

@zadjii-msft commented on GitHub (Aug 1, 2022): I feel like we've discussed this before on this repo. I bet I linked it to #9992, but I could see this as something separate, tbh.
Author
Owner

@Fulya2133 commented on GitHub (Sep 7, 2022):

Şuradan taşındı:MSFT-40653626

Şu iki şeyi yapabilsek ne güzel olurdu:

  1. Girişte başlat ayarımız tarafından giriş yapıldığında Terminal başlatıldığında için ayrı bir başlatma moduna sahip olun.
  2. Bunu elde ettikten sonra, simge durumuna küçültülmüş . Bu, insanların başlangıçta Terminal'in simge durumuna küçültülmüş olarak başlatılması gerektiğini belirtmesine izin verir ... ancak aksi takdirde normal şekilde başlatılması gerekir.
@Fulya2133 commented on GitHub (Sep 7, 2022): > _Şuradan taşındı:[MSFT-40653626](https://task.ms/40653626)_ > > Şu iki şeyi yapabilsek ne güzel olurdu: > > 1. Girişte başlat ayarımız tarafından giriş yapıldığında Terminal başlatıldığında için ayrı bir başlatma moduna sahip olun. > 2. Bunu elde ettikten sonra, simge durumuna _küçültülmüş_ . Bu, insanların başlangıçta Terminal'in simge durumuna küçültülmüş olarak başlatılması gerektiğini belirtmesine izin verir ... ancak aksi takdirde normal şekilde başlatılması gerekir.
Author
Owner

@zadjii-msft commented on GitHub (Mar 2, 2023):

notes:

ExtendedActivationKind Enum

name value description
StartupTask 1020 The app was activated because the app is specified to launch at system startup or user log-in.

And #14425 adds support for activation event args.

I bet we could:

  • Add some enum values to StartOnUserLogin for disabled, normal, minimized, headless
  • Around the time of WindowEmperor::HandleCommandlineArgs, we get the Activation args. If it's for a StartupTask, then goody, we can change the logic based on that property:
    • normal: don't change anything
    • headless: don't open a window, manually enable compatibility.allowHeadless in the emperor (at least till the next settings reload)
    • minimized: replace launchMode with minimized for all the windows we're restoring.............
@zadjii-msft commented on GitHub (Mar 2, 2023): notes: [ExtendedActivationKind Enum](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.extendedactivationkind?view=windows-app-sdk-1.2) > name | value | description > -- | -- | -- > StartupTask | 1020 | The app was activated because the app is specified to launch at system startup or user log-in. > And #14425 adds support for activation event args. I bet we could: * Add some enum values to `StartOnUserLogin` for `disabled`, `normal`, `minimized`, `headless` * Around the time of `WindowEmperor::HandleCommandlineArgs`, we get the Activation args. If it's for a StartupTask, then goody, we can change the logic based on that property: * `normal`: don't change anything * `headless`: don't open a window, manually enable `compatibility.allowHeadless` in the emperor (at least till the next settings reload) * `minimized`: replace `launchMode` with `minimized` for all the windows we're restoring............. * Dependent on #7374 * Actually, now that I say this, I feel like it doesn't play nicely with state restoration at all. Maybe `minimized` is a silly value here.
Author
Owner

@zadjii-msft commented on GitHub (May 31, 2024):

Copying notes from my whiteboard, because I just need to erase them at this point:


Can we tell if we're started for a startupTask just from the AppExecAlias?

if (startupTask
    && settings.StartOnLogin() == Headless
    ) 
{
  don't make window
  start monarch
}

Admittedly, that was written a solid year ago, so I'm not entirely sure what it means anymore.

@zadjii-msft commented on GitHub (May 31, 2024): Copying notes from my whiteboard, because I just need to erase them at this point: --- Can we tell if we're started for a `startupTask` just from the AppExecAlias? ``` if (startupTask && settings.StartOnLogin() == Headless ) { don't make window start monarch } ``` --- Admittedly, that was written a solid year ago, so I'm not entirely sure what it means anymore.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18065