Refocus click auto-submits interactive prompts (permission dialog / AskUserQuestion)

Resolved 💬 1 comment Opened Jul 2, 2026 by joeprivett Closed Jul 2, 2026

What happens

When an interactive prompt is on screen — a permission dialog, or an AskUserQuestion / choice menu — switching focus to another window and then clicking back into the terminal auto-selects/submits the first (default) option. The refocus click is consumed by the prompt as a selection, without the user ever pressing Enter.

This makes it easy to accidentally approve/reject an action just by returning to the terminal window.

Expected

A click whose only purpose is to refocus the terminal window should not be interpreted as a selection/submission in an interactive prompt. Ideally the first click after the window was unfocused is swallowed (focus-only), or there is a way to opt out of mouse-driven selection in prompts.

Environment

  • macOS (darwin)
  • Reproduced in the JetBrains/WebStorm integrated terminal; likely reproducible in other terminals that forward the focus click to the app.

Repro

  1. Trigger a permission dialog or an AskUserQuestion prompt.
  2. Switch focus to another window/app.
  3. Click back into the terminal window.
  4. The default (first) option is submitted immediately.

Suggested fix / request

Add a setting (e.g. disableMouseInput, or "ignore the click that refocuses the window") so that a refocus click cannot trigger a selection in interactive prompts. Keyboard-only confirmation for prompts would also solve it.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗