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

--window or -w sometimes creates multiple windows with same id #17799

Open
minimusubi opened this issue Aug 25, 2024 · 5 comments · May be fixed by #18215
Open

--window or -w sometimes creates multiple windows with same id #17799

minimusubi opened this issue Aug 25, 2024 · 5 comments · May be fixed by #18215
Assignees
Labels
In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@minimusubi
Copy link

Windows Terminal version

1.19.11213.0

Windows build number

10.0.19045.4651

Other Software

No response

Steps to reproduce

  1. Open a new tab in a new named window (wt.exe --window fancy-window-id new-tab)
  2. Don't close the new window for a month (???) (I'm not sure what's actually required here, but it usually seems to stop working after some time)
  3. Open a new tab in the same named window (wt.exe --window fancy-window-id new-tab)
  4. Observe a new, separate window has opened, instead of a new tab in the existing window

Expected Behavior

A new tab should have opened in the window we opened in step 1.

Actual Behavior

A new window with our new tab opens instead.

Here is a screenshot of two processes in ProcessExplorer. You can see that they have been started nearly a month apart, and that they have the same window ID specified.
image
Both windows are not elevated (note the absence of shield icons for each window)
image

@minimusubi minimusubi added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 25, 2024
@zadjii-msft
Copy link
Member

I'm really glad you mention the "Don't close the new window for a month (???)". I've got a kooky guess. I suspect that this is due to the app platform staging an update to the Terminal. 1.19 is super old at this point - 1.20 has been stable since May.

I fully suspect that because the package is half-updated, the COM object that we use to communicate across processes doesn't match from the new invocation to the old one, and so a new instance is started. Like, the Terminal should only ever have one instance of WindowsTerminal.exe ever. The fact that it's running two separate instances (one for each window) is sus as heck.

I low key bet that the Microsoft.Terminal.Remoting.dll that's used by each of these processes (if you've still got them running) will be different versions.

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 26, 2024
@minimusubi
Copy link
Author

Yep, they're still running. How could I go about checking the dll version used for each process?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Aug 26, 2024
@minimusubi
Copy link
Author

I think I found them. I used the lower pane to view DLLs for each process in Process Explorer. Let me know if this was incorrect or if there's a better way.

It seems like it's the exact same DLL for both processes. Referencing the same processes from above:

Process 13208 (started 7/27/24)

  • dll: C:\Program Files\WindowsApps\Microsoft.Windows Terminal_1.19.11213.0_x64_8wekyb3d8bbwe\Microsoft.Terminal.Remoting.dll
  • Version: 1.19.2404.30003
    image

Process 27872 (started 8/25/24)

  • dll: C:\Program Files\WindowsApps\Microsoft.Windows Terminal_1.19.11213.0_x64_8wekyb3d8bbwe\Microsoft.Terminal.Remoting.dll
  • Version: 1.19.2404.30003
    image

The DLL itself was last modified on 5/4/24.
image

@zadjii-msft
Copy link
Member

Two thoughts:

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Aug 28, 2024
@minimusubi
Copy link
Author

Yeah, you're right- there is a higher version listed, and it was created days after the first process (from the above example) was spawned.
image

Both terminal processes are unelevated (see op for screenshot)

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Aug 31, 2024
@carlos-zamora carlos-zamora added this to the Terminal v1.23 milestone Sep 4, 2024
@lhecker lhecker linked a pull request Nov 20, 2024 that will close this issue
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants