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

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

Closed
Nosamdaman opened this issue May 19, 2022 · 10 comments
Closed

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

Nosamdaman opened this issue May 19, 2022 · 10 comments
Labels
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-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@Nosamdaman
Copy link

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

@Nosamdaman Nosamdaman added the Issue-Bug It either shouldn't be doing this or needs an investigation. label May 19, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 19, 2022
@zadjii-msft
Copy link
Member

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

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 23, 2022
@Nosamdaman
Copy link
Author

Nosamdaman commented 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

@ghost ghost 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 May 23, 2022
@zadjii-msft
Copy link
Member

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/?

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Aug 1, 2022
@ghost
Copy link

ghost commented 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.

@Nosamdaman
Copy link
Author

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

@ghost ghost 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 No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Aug 5, 2022
@Wiikend92
Copy link

Wiikend92 commented 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.

@gerardosabetta
Copy link

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

@sjanssens1977
Copy link

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

@ljredux
Copy link

ljredux commented 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.

@KristofKuli
Copy link

KristofKuli commented Sep 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

7 participants