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

Closed
opened 2026-01-31 08:05:04 +00:00 by claunia · 5 comments
Owner

Originally created by @minimusubi on GitHub (Aug 25, 2024).

Originally assigned to: @lhecker on GitHub.

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

Originally created by @minimusubi on GitHub (Aug 25, 2024). Originally assigned to: @lhecker on GitHub. ### 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) 4. Open a new tab in the same named window (`wt.exe --window fancy-window-id new-tab`) 5. 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](https://github.com/user-attachments/assets/3683deb7-ed38-4cda-bf8f-d542ddcc8669) Both windows are not elevated (note the absence of shield icons for each window) ![image](https://github.com/user-attachments/assets/cc65a055-5448-4af9-a897-5f9b46cfa206)
claunia added the Needs-TriageIssue-BugIn-PRNeeds-Attention labels 2026-01-31 08:05:04 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Aug 26, 2024):

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 commented on GitHub (Aug 26, 2024): 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.
Author
Owner

@minimusubi commented on GitHub (Aug 26, 2024):

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

@minimusubi commented on GitHub (Aug 26, 2024): Yep, they're still running. How could I go about checking the dll version used for each process?
Author
Owner

@minimusubi commented on GitHub (Aug 26, 2024):

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

@minimusubi commented on GitHub (Aug 26, 2024): 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](https://github.com/user-attachments/assets/7183a5e0-6195-4c21-b4a9-270e1772aca1) ### 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](https://github.com/user-attachments/assets/ce6dbeaf-fbb0-4ee2-adc9-579ae4457737) The DLL itself was last modified on 5/4/24. ![image](https://github.com/user-attachments/assets/dd060e59-4a9d-4c62-89ed-d879c4a22d8b)
Author
Owner

@zadjii-msft commented on GitHub (Aug 28, 2024):

Two thoughts:

  • Is there a C:\Program Files\WindowsApps\Microsoft.Windows Terminal_1.{{something}} that's got a higher version number? That would lead credence to the theory that there's a new package version staged
  • Any chance you're running the second wt as admin? Or both of them as admin/? (a la #9628)
@zadjii-msft commented on GitHub (Aug 28, 2024): Two thoughts: * Is there a `C:\Program Files\WindowsApps\Microsoft.Windows Terminal_1.{{something}}` that's got a higher version number? That would lead credence to the theory that there's a new package version staged * Any chance you're running the second `wt` as admin? Or both of them as admin/? (a la #9628)
Author
Owner

@minimusubi commented on GitHub (Aug 31, 2024):

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)

@minimusubi commented on GitHub (Aug 31, 2024): 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](https://github.com/user-attachments/assets/4eaed2eb-4b9e-48f9-a0a0-d352a4996a4a) Both terminal processes are unelevated (see op for screenshot)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22158