New window instances do not gain foreground rights #22661

Closed
opened 2026-01-31 08:19:47 +00:00 by claunia · 2 comments
Owner

Originally created by @lhecker on GitHub (Dec 13, 2024).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.23.3471.0

Windows build number

No response

Other Software

No response

Steps to reproduce

  • Set "New instance behavior" to "Create a new window"
  • Launch from the start menu (= first window, first tab)
  • Explicitly minimize
  • Launch from the start menu again

Expected Behavior

New window is in the foreground.

Actual Behavior

New window fails to gain foreground rights.

Originally created by @lhecker on GitHub (Dec 13, 2024). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.23.3471.0 ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce * Set "New instance behavior" to "Create a new window" * Launch from the start menu (= first window, first tab) * Explicitly minimize * Launch from the start menu again ### Expected Behavior New window is in the foreground. ### Actual Behavior New window fails to gain foreground rights.
Author
Owner

@zadjii-msft commented on GitHub (Dec 13, 2024):

Can we AllowSetForeground? I suppose we don't know the PID of the instance holding the mutex, do we. hmm....

@zadjii-msft commented on GitHub (Dec 13, 2024): Can we `AllowSetForeground`? I suppose we don't know the PID of the instance holding the mutex, do we. hmm....
Author
Owner

@lhecker commented on GitHub (Dec 13, 2024):

Oh, I didn't see your message! And yeah, I fixed it exactly like that. We can get the PID with GetWindowThreadProcessId.

@lhecker commented on GitHub (Dec 13, 2024): Oh, I didn't see your message! And yeah, I fixed it exactly like that. We can get the PID with `GetWindowThreadProcessId`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22661