Clicking to refocus iTerm2 window can be captured as a mouse click on the permission prompt, silently selecting "No"
Description
When Claude Code shows a permission prompt (Yes/No) and the terminal window loses OS focus (e.g., after switching to another app to look something up), clicking back into the iTerm2 window to refocus it is sometimes captured by Claude Code's terminal mouse-reporting as a click on the prompt itself — silently registering "No" (deny) before the user has a chance to actually read the prompt.
This happens because the click used purely to restore OS focus to the terminal lands at the same screen coordinates as an interactive prompt option, and the terminal forwards it to the foreground app as a real mouse event rather than treating it as a focus-only click.
Impact
The denial happens silently — there's no visible confirmation that a click was "eaten" as a No response, so the user doesn't realize their permission was denied until they notice the requested action never happened. In my case this repeatedly interrupted a long editing session.
Environment
- Terminal: iTerm2 (macOS)
- Trigger: clicking anywhere in the iTerm2 window to bring it back into focus after switching away, while a Yes/No permission prompt is on-screen
Steps to reproduce
- Trigger a Claude Code action that shows a Yes/No permission prompt
- Switch focus away from the terminal to another application (without answering the prompt)
- Click back into the iTerm2 window at a screen position that happens to overlap the prompt's option area
- The click is registered as a selection (often "No") instead of just refocusing the window
Suggested fix / discussion
Ideas that might help (not prescribing an implementation — just what came to mind):
- Ignore/debounce the first mouse event received immediately after the terminal regains OS focus
- Require prompt responses via keyboard only (disable mouse click-to-select on Yes/No prompts), or require a click and the window already being focused
- Visually confirm which option was selected before committing, with a brief window to undo