Refocus click auto-submits interactive prompts (permission dialog / AskUserQuestion)
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
- Trigger a permission dialog or an
AskUserQuestionprompt. - Switch focus to another window/app.
- Click back into the terminal window.
- 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.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗