Terminal Doesn't Start With Focus When Launched From Search #17516

Closed
opened 2026-01-31 05:44:48 +00:00 by claunia · 10 comments
Owner

Originally created by @Nosamdaman on GitHub (May 19, 2022).

Windows Terminal version

1.12.10983.0

Windows build number

10.0.22000.675

Other Software

No response

Steps to reproduce

  1. Be on Windows 11 and configure Windows Terminal to be the default console host
  2. Click on the desktop so that your active "window" is the desktop
  3. Press the Windows key, type "wt", and press enter

Expected Behavior

Terminal should launch and have focus

Actual Behavior

Terminal launches, but is not the active window

Originally created by @Nosamdaman on GitHub (May 19, 2022). ### Windows Terminal version 1.12.10983.0 ### Windows build number 10.0.22000.675 ### Other Software _No response_ ### Steps to reproduce 1. Be on Windows 11 and configure Windows Terminal to be the default console host 2. Click on the desktop so that your active "window" is the desktop 3. Press the Windows key, type "wt", and press enter ### Expected Behavior Terminal should launch and have focus ### Actual Behavior Terminal launches, but is not the active window
claunia added the Needs-TriageIssue-BugNeeds-Tag-FixNeeds-Attention labels 2026-01-31 05:44:48 +00:00
Author
Owner

@zadjii-msft commented on GitHub (May 23, 2022):

By any chance, is your default profile a WSL one/? This sounds like #12134

@zadjii-msft commented on GitHub (May 23, 2022): By any chance, is your default profile a WSL one/? This sounds like #12134
Author
Owner

@Nosamdaman commented on GitHub (May 23, 2022):

By any chance, is your default profile a WSL one/? This sounds like #12134

While that does sound awfully similar, my default profile is Powershell Core

@Nosamdaman commented on GitHub (May 23, 2022): > By any chance, is your default profile a WSL one/? This sounds like #12134 While that does sound awfully similar, my default profile is Powershell Core
Author
Owner

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

By any chance, does the Terminal lose focus whenever you open a new tab, a la #13388? You're on Windows 11, but I don't think the root cause of the issue I linked is unique to Windows 10, just more common. WAIT NO. That's definitely not the same bug - you reported this on 1.12, LONG before the focus/fg work I thought triggered that bug.

That being said, there was also a set of insiders builds that had horribly messed up app activation. I don't know what build numbers those were off the top of my head, but they should have been fixed by now. You still seeing this on the latest Windows 11 builds/?

@zadjii-msft commented on GitHub (Aug 1, 2022): ~By any chance, does the Terminal _lose_ focus whenever you open a new tab, a la #13388? You're on Windows 11, but I don't think the root cause of the issue I linked is unique to Windows 10, just more common.~ WAIT NO. That's definitely not the same bug - you reported this on 1.12, LONG before the focus/fg work I thought triggered that bug. That being said, there was also a set of insiders builds that had horribly messed up app activation. I don't know what build numbers those were off the top of my head, but they should have been fixed by now. You still seeing this on the latest Windows 11 builds/?
Author
Owner

@ghost commented on GitHub (Aug 5, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 5, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@Nosamdaman commented on GitHub (Aug 5, 2022):

Yeah I think this is a windows issue, not a terminal one, as I've seen it happen with other apps. I'll close it for now

@Nosamdaman commented on GitHub (Aug 5, 2022): Yeah I think this is a windows issue, not a terminal one, as I've seen it happen with other apps. I'll close it for now
Author
Owner

@Wiikend92 commented on GitHub (Oct 13, 2023):

I am experiencing this on Windows 11 with Windows Terminal 1.18.2822.0. My default profile is PowerShell 7.3.8.0, installed from the Microsoft Store. The first time this happened to me was today.

I did some testing, and it seems to only happen when you open a new instance of WT while a processes is running in WSL. Once you hit this bug, you have to close all WT instances to get rid of it. After closing all WT instances, you can open new instances in the foreground as expected.

I noticed it first because I have a tunnel to some database server running in WSL, but sleep 10 will do:

PS C:\path\to\home> wsl
user@computer:/path/to/home$ sleep 10

Within the 10 second sleep period, try to open another Windows Terminal instance from search. It will open in the background, and all new instances will do so until you close all the instances. Then you can open WT in the foreground again. Pretty infuriating stuff.

I took the advice of zadjii-msft in his comment on #12134, adding

[wsl2]
guiApplications=false

to .wslconfig, and that resolved the problem. Since I am not using GUI applications in WSL, that was an acceptable workaround for me. Hope this helps fix the error, and get around it in the meantime for anyone seeing this.

@Wiikend92 commented on GitHub (Oct 13, 2023): I am experiencing this on Windows 11 with Windows Terminal 1.18.2822.0. My default profile is PowerShell 7.3.8.0, installed from the Microsoft Store. The first time this happened to me was today. I did some testing, and it seems to only happen when you open a new instance of WT while a processes is running in WSL. Once you hit this bug, you have to close all WT instances to get rid of it. After closing all WT instances, you can open new instances in the foreground as expected. I noticed it first because I have a tunnel to some database server running in WSL, but `sleep 10` will do: ```PowerShell PS C:\path\to\home> wsl ``` ```bash user@computer:/path/to/home$ sleep 10 ``` Within the 10 second sleep period, try to open another Windows Terminal instance from search. It will open in the background, and all new instances will do so until you close all the instances. Then you can open WT in the foreground again. Pretty infuriating stuff. I took the advice of [zadjii-msft](https://github.com/microsoft/terminal/issues/12134#issuecomment-1010333944) in his comment on #12134, adding ```ini [wsl2] guiApplications=false ``` to `.wslconfig`, and that resolved the problem. Since I am not using GUI applications in WSL, that was an acceptable workaround for me. Hope this helps fix the error, and get around it in the meantime for anyone seeing this.
Author
Owner

@gerardosabetta commented on GitHub (Dec 3, 2023):

This is also happening for me, the weird thing is this only happens when I search for "Terminal" if I search for powershell or my wsl distro, it launches the same binary and it does pop up as a new window with the active focus on it. I don't understand why it behaves differently. Launching terminal opens the app behind all other windows so I have to alt tab into it, pretty annoying

@gerardosabetta commented on GitHub (Dec 3, 2023): This is also happening for me, the weird thing is this only happens when I search for "Terminal" if I search for powershell or my wsl distro, it launches the same binary and it does pop up as a new window with the active focus on it. I don't understand why it behaves differently. Launching terminal opens the app behind all other windows so I have to alt tab into it, pretty annoying
Author
Owner

@sjanssens1977 commented on GitHub (Jan 22, 2024):

Same focus issue

Windows Terminal Version

1.18.3181.0

Windows Version

Edition Windows 10 Enterprise
Version 22H2
OS build 19045.3930
Experience Windows Feature Experience Pack 1000.19053.1000.0

Specifics:

Windows Terminal is pinned to the taskbar

Steps to reproduce:

  1. Press ++
  2. Use arrow keypad to select the profile and press enter
  3. Windows Terminal opens but window is not activated
@sjanssens1977 commented on GitHub (Jan 22, 2024): Same focus issue ### Windows Terminal Version 1.18.3181.0 ### Windows Version Edition Windows 10 Enterprise Version 22H2 OS build 19045.3930 Experience Windows Feature Experience Pack 1000.19053.1000.0 ### Specifics: Windows Terminal is pinned to the taskbar ### Steps to reproduce: 1. Press <ALT>+<Win>+<Rank number of the Terminal icon in the taskbar> 2. Use arrow keypad to select the profile and press enter 3. Windows Terminal opens but window is not activated
Author
Owner

@ljredux commented on GitHub (May 31, 2024):

Not sure if this is helpful to any of you, but I discovered it was happening to me due to Quake Mode. As soon I activate it that way (and I do use Quake Mode a lot), new Windows terminal instances will not have focus upon launch.

If I type exit in Quake Mode, further launches of Windows Terminal have focus again as expected.

@ljredux commented on GitHub (May 31, 2024): Not sure if this is helpful to any of you, but I discovered it was happening to me due to [Quake Mode](https://learn.microsoft.com/en-us/windows/terminal/tips-and-tricks#quake-mode). As soon I activate it that way (and I do use Quake Mode a lot), new Windows terminal instances will not have focus upon launch. If I type exit in Quake Mode, further launches of Windows Terminal have focus again as expected.
Author
Owner

@KristofKuli commented on GitHub (Sep 18, 2024):

Workaround:
Once you have opened cmd, press Alt + F4 and the focus will appear. No joke!

@KristofKuli commented on GitHub (Sep 18, 2024): Workaround: Once you have opened cmd, press Alt + F4 and the focus will appear. No joke!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17516