Skip to content

Copilot CLI "Focus Stealing" #1281

@rbroggi

Description

@rbroggi

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

  1. Initiate a task via Copilot CLI that requires multiple steps or iterative feedback (e.g., gh copilot suggest or an interactive agent session).
  2. While the agent is processing, switch focus to another application (e.g., VS Code, a browser, or Slack).
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions