-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Comments
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) |
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. |
note to self: when we get to a quorum for discussion again, refer to comments in #13306 |
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.
The text was updated successfully, but these errors were encountered: