Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
vertigo220 opened this issue Jul 25, 2022 · 3 comments
Labels
Area-Quality Stability, Performance, Etc. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@vertigo220
Copy link

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.

@vertigo220 vertigo220 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jul 25, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 25, 2022
@zadjii-msft
Copy link
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)

@vertigo220
Copy link
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.

@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Discussion Something that requires a team discussion before we can proceed and removed Issue-Bug It either shouldn't be doing this or needs an investigation. labels Jul 26, 2022
@zadjii-msft
Copy link
Member

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

@zadjii-msft zadjii-msft added this to the Terminal v1.18 milestone Aug 29, 2022
@zadjii-msft zadjii-msft removed the Needs-Discussion Something that requires a team discussion before we can proceed label Aug 29, 2022
@carlos-zamora carlos-zamora modified the milestones: Terminal v1.19, Backlog Aug 9, 2023
@carlos-zamora carlos-zamora added Area-Quality Stability, Performance, Etc. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Quality Stability, Performance, Etc. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants