-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe the feature or problem you'd like to solve
Copilot CLI "Focus Stealing" during Multi-Step Agent Tasks
Proposed solution
Description
When using the GitHub Copilot CLI (specifically during long-running agentic tasks), the terminal application forcibly takes window focus every time the agent requires user interaction or permission. This happens even if the user has navigated away to another application.
Steps to Reproduce
- Initiate a task via Copilot CLI that requires multiple steps or iterative feedback (e.g.,
gh copilot suggestor an interactive agent session). - While the agent is processing, switch focus to another application (e.g., VS Code, a browser, or Slack).
- Wait for the agent to reach a point where it requires a "Yes/No" permission or a text input.
Expected Behavior
The terminal should remain in the background. The user should be notified (e.g., via a terminal bell or a system notification) that input is required, allowing them to switch back manually when ready.
Actual Behavior
The terminal application "steals focus," instantly snapping the user back to the CLI. This interrupts active typing or reading in other applications.
Proposed Solution
- Default Behavior Change: Disable automatic focus stealing by default.
- System Notifications: Instead of snapping focus, trigger a standard OS-level system notification (macOS/Windows/Linux) when the agent is "blocked" awaiting user input.
- User Configuration: Add a flag or configuration setting (e.g.,
gh copilot config set auto-focus false) to allow users to opt-in to this behavior if they actually prefer it.
Example prompts or workflows
No response
Additional context
No response
antonstjernquist