microsoft / microsoft/terminal

Agent working in background opens new terminal tab and steals focus

Open
#20,692 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug Needs-Triage
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### 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 :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior on Windows Terminal 1.24.11911.0 with GitHub Copilot CLI v1.0.85 while another application has focus. Trace the tab-opening path and focus changes; done means a tab opened by background agent work leaves Terminal in the background and does not steal focus.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.