Agent working in background opens new terminal tab and steals focus
Windows Terminal version
1.24.11911.0
Windows build number
10.0.26200.0
Other Software
GitHub Copilot CLI v1.0.85
Steps to reproduce
Let agent do some work that results in it running a command that at some point opens a new terminal tab while you're doing something else in a different program.
Expected Behavior
If whatever AI agent is doing in the background involves opening a new Terminal tab, the Terminal should stay in the background and not disrupt my work.
Actual Behavior
Whenever a new Terminal tab is open by agent working in the background, the whole Terminal window is brought up to the foreground and steals focus from whatever I was doing at the time.
Note: I think agents should not normally open new terminal tabs for running commands, and they usually don't, but sometimes it just happens, possibly as a result of ignoring instructions and executing something with cmd /c but it's beside of the scope of this issue. If they do any stupid things, they should be let to deal with it :)
Source: microsoft/terminal