question about other processes stealing focus from WT #11784

Closed
opened 2026-01-31 02:57:18 +00:00 by claunia · 5 comments
Owner

Originally created by @rodrymbo on GitHub (Dec 12, 2020).

From time to time when working in WT, some other program will steal focus. This is particularly annoying when I am entering a password. Am I missing something or is there a way to keep that from happening? (Yes, part/most of the problem is the other process thinking it needs focus when it clearly just wants to let me know about something and doesn't even want a response ... in at least one case focus returns to WT after the other process closes without input from me.)

I could first make sure nothing else is running or likely to run, but that's boring.

I think I can come up with examples if someone wants to see it happen.

Sometimes I think a solution is some sort of "secure desktop" that could be triggered by a terminal control code, e.g. when prompting for a password, then switch back again once the password is entered.

Originally created by @rodrymbo on GitHub (Dec 12, 2020). From time to time when working in WT, some other program will steal focus. This is particularly annoying when I am entering a password. Am I missing something or is there a way to keep that from happening? (Yes, part/most of the problem is the other process thinking it needs focus when it clearly just wants to let me know about something and doesn't even want a response ... in at least one case focus returns to WT after the other process closes without input from me.) I could first make sure nothing else is running or likely to run, but that's boring. I think I can come up with examples if someone wants to see it happen. Sometimes I think a solution is some sort of "secure desktop" that could be triggered by a terminal control code, e.g. when prompting for a password, then switch back again once the password is entered.
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 02:57:18 +00:00
Author
Owner

@skyline75489 commented on GitHub (Dec 14, 2020):

I think focus mode might help but I'm not entirely positive.

@skyline75489 commented on GitHub (Dec 14, 2020): I think [focus mode](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#toggle-focus-mode) might help but I'm not entirely positive.
Author
Owner

@zadjii-msft commented on GitHub (Dec 14, 2020):

So like, this isn't just a Terminal problem though, right? Maybe I'm misunderstanding, but to me this sounds like "some times I'm in an app, and another app steals focus". Not really specific to the Terminal, but a broader problem in a windowed desktop environment.

IMO the problem is probably with the other application stealing focus when you're not expecting it. I know VS does this all the time, and it's just the worst, but that's a VS problem.

I'm not sure there's any way for an app to tell the OS "please don't focus other windows until I tell you okay?" Because immediately, that would get abused by apps that never tell the OS it's okay to start focusing other windows again.

@zadjii-msft commented on GitHub (Dec 14, 2020): So like, this isn't just a Terminal problem though, right? Maybe I'm misunderstanding, but to me this sounds like "some times I'm in _an app_, and _another app_ steals focus". Not really specific to the Terminal, but a broader problem in a windowed desktop environment. IMO the problem is probably with the other application stealing focus when you're not expecting it. I know VS does this all the time, and it's just the worst, but that's a VS problem. I'm not sure there's any way for an app to tell the OS "please don't focus other windows until I tell you okay?" Because immediately, that would get abused by apps that _never_ tell the OS it's okay to start focusing other windows again.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Dec 14, 2020):

SystemParametersInfo SPI_SETFOREGROUNDLOCKTIMEOUT is a bit like that.

@KalleOlaviNiemitalo commented on GitHub (Dec 14, 2020): SystemParametersInfo SPI_SETFOREGROUNDLOCKTIMEOUT is a bit like that.
Author
Owner

@rodrymbo commented on GitHub (Dec 15, 2020):

@zadjii-msft

Exactly right. The same would happen with the old console.

If I knew how to fix or replace the offending programs I would, or even how to identify them. Sigh.

If I identify Microsoft products that are behaving badly like this, I'll let you know.

@rodrymbo commented on GitHub (Dec 15, 2020): @zadjii-msft Exactly right. The same would happen with the old console. If I knew how to fix or replace the offending programs I would, or even how to identify them. Sigh. If I identify Microsoft products that are behaving badly like this, I'll let you know.
Author
Owner

@DHowett commented on GitHub (Dec 17, 2020):

Thanks for the report. Unfortunately, it's not actionable from our side (I'd like to enable that suppression flag, but I know that that's just entering into an arms race.)

For now, I'm gonna close this out.

@DHowett commented on GitHub (Dec 17, 2020): Thanks for the report. Unfortunately, it's not actionable from our side (I'd like to enable that suppression flag, but I know that that's just entering into an arms race.) For now, I'm gonna close this out.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11784