Skip to content

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

Open

Description

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.

Activity

  1. added
    Issue-Feature
    Area-UserInterface
    Area-Settings
    Product-Terminal
    on Jul 29, 2022
  2. ghost added
    Needs-Triage
    on Jul 29, 2022
  3. zadjii-msft commented on Aug 1, 2022

    @zadjii-msft
    Member

    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.

  4. removed
    Needs-Triage
    on Aug 1, 2022
  5. Fulya2133 commented on Sep 7, 2022

    @Fulya2133
  6. zadjii-msft commented on Mar 2, 2023

    @zadjii-msft
    Member

    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.............

    xref
    #9996 (comment)

    Really the hard open question is just "how does this feature interact with state restoration?" Should we:

    • for --minimized:

      • 1A restore all the windows, but also SW_HIDE them to minimize them?
      • 1B Or just restore them normally, and create the new window minimized.
    • for --headless:

      • 2A restore them on launch?
      • 2B not restore them until the first window is created?

    Hell I think you could just go with 1B and 2A and call it a day.

  7. zadjii-msft commented on May 31, 2024

    @zadjii-msft
    Member

    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.

  8. added
    In-PR
    on Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsArea-UserInterfaceIn-PRIssue-FeatureProduct-Terminal

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions