"Open Terminal Here" does not focus the Terminal windows #9176

Closed
opened 2026-01-31 01:47:53 +00:00 by claunia · 15 comments
Owner

Originally created by @lllopo on GitHub (Jun 20, 2020).

Environment

Microsoft Windows [Version 10.0.19041.329]
Windows Terminal Preview
Version: 1.1.1671.0

Steps to reproduce

  1. Open windows explorer
  2. Right click on a folder
  3. Select "Open in Windows Terminal"

Expected behavior

A Windows Terminal windows is opened and get's focused / comes to foreground

Actual behavior

A Windows Terminal windows is opened, but appears behind the windows explorer window, which remains focused.

Originally created by @lllopo on GitHub (Jun 20, 2020). # Environment Microsoft Windows [Version 10.0.19041.329] Windows Terminal Preview Version: 1.1.1671.0 # Steps to reproduce 1. Open windows explorer 2. Right click on a folder 3. Select "Open in Windows Terminal" # Expected behavior A Windows Terminal windows is opened and get's focused / comes to foreground # Actual behavior A Windows Terminal windows is opened, but appears behind the windows explorer window, which remains focused.
Author
Owner

@zadjii-msft commented on GitHub (Jun 22, 2020):

I don't doubt this is a real bug, but I couldn't get it to happen in the last 10 Terminals I spawned using the shortcut. We'll probably need someone else on the dev team to be able to repro this 😕

@zadjii-msft commented on GitHub (Jun 22, 2020): I don't doubt this is a real bug, but I couldn't get it to happen in the last 10 Terminals I spawned using the shortcut. We'll probably need someone else on the dev team to be able to repro this 😕
Author
Owner

@lllopo commented on GitHub (Jun 22, 2020):

@zadjii-msft I hope you mange to reproduce it somehow at some moment, as it is very annoying. Here a small demo :

ezgif-6-62d50b430593

@lllopo commented on GitHub (Jun 22, 2020): @zadjii-msft I hope you mange to reproduce it somehow at some moment, as it is very annoying. Here a small demo : ![ezgif-6-62d50b430593](https://user-images.githubusercontent.com/5485902/85321080-c6365900-b4cc-11ea-89ae-1ea78c403277.gif)
Author
Owner

@DHowett commented on GitHub (Jun 25, 2020):

Ugh, another papercut from MSIX.

Thanks.

@DHowett commented on GitHub (Jun 25, 2020): Ugh, another papercut from MSIX. Thanks.
Author
Owner

@lllopo commented on GitHub (Jul 23, 2020):

The latest 1.2.2022.0 seems to fix this for me.

@lllopo commented on GitHub (Jul 23, 2020): The latest 1.2.2022.0 seems to fix this for me.
Author
Owner

@OMA2k commented on GitHub (Nov 8, 2020):

I'm getting a similar behaviour when doing the opposite operation, i.e: If I type "start nameOfFolder" in the Terminal window, then Windows Explorer opens with that folder but it appears BEHIND the Terminal, instead of in the front! This must be some issue with this Terminal, because it doesn't happen with the regular Command Prompt nor with the regular PowerShell window.

@OMA2k commented on GitHub (Nov 8, 2020): I'm getting a similar behaviour when doing the opposite operation, i.e: If I type "start nameOfFolder" in the Terminal window, then Windows Explorer opens with that folder but it appears BEHIND the Terminal, instead of in the front! This must be some issue with this Terminal, because it doesn't happen with the regular Command Prompt nor with the regular PowerShell window.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Nov 8, 2020):

@OMA2k, the problem with "start nameOfFolder" may be https://github.com/microsoft/terminal/issues/2988.

@KalleOlaviNiemitalo commented on GitHub (Nov 8, 2020): @OMA2k, the problem with "start nameOfFolder" may be <https://github.com/microsoft/terminal/issues/2988>.
Author
Owner

@siolfyr commented on GitHub (May 9, 2022):

For me, in Windows 11, this is always the behavior. No matter how I open Windows Terminal, it is never focused until I click on it.

Edit: Never mind, it only happens when opening the program from search. If I open it from a shortcut it works normally.

@siolfyr commented on GitHub (May 9, 2022): For me, in Windows 11, this is always the behavior. No matter how I open Windows Terminal, it is never focused until I click on it. Edit: Never mind, it only happens when opening the program from search. If I open it from a shortcut it works normally.
Author
Owner

@dbechrd commented on GitHub (Aug 21, 2022):

This also happens to me on Windows 11 when opening from start menu via keyboard. Extremely annoying as that's the fastest way to open it by far.

@dbechrd commented on GitHub (Aug 21, 2022): This also happens to me on Windows 11 when opening from start menu via keyboard. Extremely annoying as that's the fastest way to open it by far.
Author
Owner

@nomius commented on GitHub (Aug 26, 2022):

This also happens to me on Windows 11 when opening from start menu via keyboard. Extremely annoying as that's the fastest way to open it by far.

Same happens here.

@nomius commented on GitHub (Aug 26, 2022): > This also happens to me on Windows 11 when opening from start menu via keyboard. Extremely annoying as that's the fastest way to open it by far. Same happens here.
Author
Owner

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

@dbechrd & @nomius You're probably seeing #13388 - this thread is specific to launching via the context menu. I know that sounds like nitpicking, but I think I have an idea what's causing #13388, while I'm pretty sure whatever the root cause of this thread is out of our immediate control.

@zadjii-msft commented on GitHub (Aug 26, 2022): @dbechrd & @nomius You're probably seeing #13388 - this thread is specific to launching via the context menu. I know that sounds like nitpicking, but I think I have an idea what's causing #13388, while I'm pretty sure whatever the root cause of this thread is out of our immediate control.
Author
Owner

@zadjii-msft commented on GitHub (Feb 6, 2023):

This might have just been fixed on it's own by Windows 11. I'm certainly not seeing this on 25294. I'd have basically no way of knowing if the fix got backported to win10 branches - @lllopo You still seeing this/?

@zadjii-msft commented on GitHub (Feb 6, 2023): This might have just been fixed on it's own by Windows 11. I'm certainly not seeing this on 25294. I'd have basically no way of knowing if the fix got backported to win10 branches - @lllopo You still seeing this/?
Author
Owner

@lllopo commented on GitHub (Feb 6, 2023):

@zadjii-msft Now that you mention it - it seems fixed for me too (I'm still on Win10).

@lllopo commented on GitHub (Feb 6, 2023): @zadjii-msft Now that you mention it - it seems fixed for me too (I'm still on Win10).
Author
Owner

@soredake commented on GitHub (Jun 8, 2023):

Works fine in windows 11 as of today.

@soredake commented on GitHub (Jun 8, 2023): Works fine in windows 11 as of today.
Author
Owner

@lhecker commented on GitHub (Aug 30, 2023):

Thanks for filing the issue. It seems to be fixed (or at least better) now, so I'll go ahead and close this. We still have "Windows Terminal not being in the foreground" issues in general, like when you open it via the start menu sometimes, etc., but those issues are already being tracked elsewhere.

@lhecker commented on GitHub (Aug 30, 2023): Thanks for filing the issue. It seems to be fixed (or at least better) now, so I'll go ahead and close this. We still have "Windows Terminal not being in the foreground" issues in general, like when you open it via the start menu sometimes, etc., but those issues are already being tracked elsewhere.
Author
Owner

@carodgers commented on GitHub (Dec 6, 2023):

Wanted to add that I learned one way to toggle this behavior on/off.

If I open Ubuntu in WSL, and then separately click "Open in Terminal" from an Explorer folder window, the Terminal window opens behind the folder window and does not get focus. But if I close all instances of Ubuntu and try again, Terminal appears in front of the folder window and gets focus.

Edit: I've opened a new issue and crosslinked to it: https://github.com/microsoft/terminal/issues/16433

@carodgers commented on GitHub (Dec 6, 2023): Wanted to add that I learned one way to toggle this behavior on/off. If I open Ubuntu in WSL, and then separately click "Open in Terminal" from an Explorer folder window, the Terminal window opens behind the folder window and does not get focus. But if I close all instances of Ubuntu and try again, Terminal appears in front of the folder window and gets focus. Edit: I've opened a new issue and crosslinked to it: https://github.com/microsoft/terminal/issues/16433
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9176