-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Clicking shortcut to WT PowerShell profile opens 2 windows #14799
Comments
Are you sure you have 1.16.10261 installed? That's the version for Windows 10. You can replace it with 1.16.10262 from here. Additionally I'm not sure how your 1. and 2. step fit together: The "PowerShell" profile is a standard profile and should always exist unless you deleted it previously. Is "PowerShell" in your first step just an example or is the 2. step optional? Interesting... I can't reproduce this behavior with 1.16.10262.0 and PowerShell 7.3.2. What happens if you add |
I have "Open Windows from a previous session". That might be it. I was hoping to see my previous PS session. |
Did this turn out to be your issue? |
I've run into this as well. Using
I think the expected behavior here is that a single window is opened with the previous session and a new shell instance is added to that window.
Version 1.16.10261.0 on Windows 10 |
Yea, this is just kinda by-design for now. If you don't have any Terminal windows open, and have I suppose theoretically, this could also respect the I'll leave this open, on the backlog. I've been playing in the state restoration code quite a bit recently, and I don't think this would be super easy to fix... |
Just as a data point one place where this comes up naturally is vscode. When it launches an external terminal it passes the current directory. I don't think this is configurable by the user, but it's the desired behavior in any case. Respecting |
I had the same issue and I initially (naively confused!) thought this was VSCode's issue. Based on what I've read here, the current behavior is respecting some conventions, but I guess you might be able to add some third option or a flag? Then that flag might be usable in VSCode default terminal settings (I've not tested this though). |
My expected behavior is also, that if I use default Start Menu shortcut (that Windows store created when installing Terminal) to launch the Terminal, it'll restore my old session as/if configured from the settings to do so, but does NOT open anything else UNLESS I specifically tell it to with separate arguments. And there's a lot of different possibilities: There's a difference choosing between these things: Open previous session tabs and windows It's many things and possibilities and as it stands it doesn't seem to be very exclusive in how to handle it properly. From browsers I've come to expect (and from notepad++ for that matter) that launching the application itself without arguments doesn't automatically open new tab or window, it either restores my old session 1:1 OR starts from scratch depending what configuration was active. If I want to open extra tab/window to a location, I should explicitly command it to do so. As a user, I expect it to open to the last window I used in the session that's being restored (let's say session had 3 windows, if I was using specific window before closing the session [based on what window was in focus?], THAT'S the one I expect the new tab to open to), unless I specifically have an option to choose where it opens to based on arguments or profile configuration. Like in NPP, It opens all the previous tabs AND it'll attach the new file that I gave as an argument to the end of that tab list. I hope you'll figure it out... it's not an easy problem by any means to tackle. :) |
Guys what if we restored both the unelevated and the elevated windows when either are launched? |
Windows Terminal version
1.16.10261.0
Windows build number
Edition Windows 11 Pro Version 22H2 Installed on 12-8-2022 OS build 22621.1194 Experience Windows Feature Experience Pack 1000.22638.1000.0
Other Software
PowerShell 7.3.2
Steps to reproduce
1 Create a Windows shortcut with the command line
C:\Users\willp\AppData\Local\Microsoft\WindowsApps\wt.exe -p "PowerShell"
2 Create a matching WT profile
3 Click the shortcut
How many windows opened?
Expected Behavior
I'd expect only at most one new window.
Actual Behavior
With no WT widows open, I get two to the same profile.
The text was updated successfully, but these errors were encountered: