Skip to content

Ctrl+clicking on profile in dropdown to open as adminstrator launches it twice (opens two windows), with a random mix of two profiles #13596

Open

Description

@vertigo220

Windows Terminal version

1.14.1962.0

Windows build number

Version 21H2 (OS Build 19044.1826)

Other Software

No response

Steps to reproduce

Click down arrow next to new tab button
Ctrl+click a profile to run it as admin

Expected Behavior

One window of the selected profile should open as admin

Actual Behavior

Two admin windows open, sometimes both as the selected profile, sometimes one as the selected profile and one as another. It's always either cmd or PS for me, even though I have the default Azure shell as the third option, so not sure why that one's not being opened. I can only assume because I've never run one before. As a test, I ran one, then tried it, and it still didn't open one (though I only tried once or twice), then I opened a new Azure window as admin and closed it and tried again, and then I started getting them in the random mix. I then closed the Azure tab thinking maybe it only used currently open tabs, and after several attempts I didn't get any more Azure windows, but I also seemed to stop getting PS ones (so just double cmd windows each time). But after ctrl+clicking on Azure and closing the windows that opened up, I started getting them again. Also, I didn't have any PS tabs open throughout all of this (did earlier, but they've been closed for a day or two), so it's not using current tabs.

Activity

  1. added
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    on Jul 25, 2022
  2. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jul 25, 2022
  3. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Jul 25, 2022
  4. zadjii-msft commented on Jul 25, 2022

    @zadjii-msft
    Member

    More or less, I'm guessing this is due to reusing the tabs from last time. Admittedly, the repro steps here aren't the most precise, so I can't break it down exactly what's happening. Restoring the previous windows from last time uses a separate set of windows for both elevated and unelevated instances of the Terminal. So opening an elevated window, opening another tab in there, closing the window, then ctrl+clicking on a profile will open two windows - the two tabs from before, and a new window for the newly-created profile.

    I'll admit, it's not the most ergonomic experience. I run into this pretty regularly myself, I usually have one window for admin stuff, but then use ctrl+click to spawn an elevated instance and end up with two admin windows. There's no good way to say "I want to restore previous instances, but not for elevated windows". Nor is there a good way to say "just open up an elevated terminal window (or the set of elevated windows from before" (Though, that could be tracked by #12191)

  5. vertigo220 commented on Jul 25, 2022

    @vertigo220
    Author

    That still doesn't explain why it's ~50/50 whether it opens two windows of the same shell or one window of the selected shell and one of another.

    Maybe because I'm running on minimal sleep, but it took me a couple reads to figure out what you were saying is causing this. That certainly makes sense, and I understand the problem, more-or-less, but it's not only an annoyance but it appears to be a bug, hence why I submitted it, and I worry it will cause others to waste time searching and/or posting about it.

    At the very least, there should probably be a warning in the tooltip about this behavior, but I wonder, if you can't use different "restore previous session" settings based on admin or non-admin, what about based on whether Terminal is already running, i.e. if it's the only instance running, it restores the previous session, but if it's a child process of the first, or just not the only instance, it doesn't. Alternately, if a new window is launched, as in the case of running a shell as admin, it could open it as part of the previous session, so instead of two windows you'd get one window with two tabs. And as a possible option to that, if the previous session was only one tab, an assumption could be made that it's not actually a session but just a single window that was opened then closed, and wasn't intended to be saved.

  6. added
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    Needs-DiscussionSomething that requires a team discussion before we can proceed
    and removed
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    on Jul 26, 2022
  7. zadjii-msft commented on Aug 11, 2022

    @zadjii-msft
    Member

    note to self: when we get to a quorum for discussion again, refer to comments in #13306

  8. added
    Area-QualityStability, Performance, Etc.
    and removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    Needs-Tag-FixDoesn't match tag requirements
    on Aug 9, 2023
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-QualityStability, Performance, Etc.Issue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions