[BUG] Mods: a click on a pane Button leaves the keys with the prompt, so a field it opens can't take them while the prompt has text
What happens
In the terminal, a click on a mod pane's Button presses it, but the keys stay with the prompt. A click on empty space in the pane also leaves them there. A click on an Input does give it the keys.
So a press that opens a text field can give the field the keys only through $.ui.open({ id, focus: true }) and then $.ui.focus. While the prompt has text, open({ focus }) is refused, as its types say. The field draws, but the letters the person types next go into the prompt.
Expected
The Button.hotkey types say a site holds the keys "after ctrl+x tab, a click or open({ focus })". So a click in the pane should give the pane the keys. Then $.ui.focus could move them to the field the press opened.
Repro
- Draw a pane with a
ButtonwhoseonPressdraws anInputwithautoFocus, then calls$.ui.open({ id, focus: true })and$.ui.focus({ requestId: id, key: <the Input's key> }). - Type some text in the prompt.
- Click the Button.
- Type a few letters. They go to the prompt, not to the field.
With an empty prompt, the same steps work, because open({ focus }) is granted.
Environment
- Claude Code 2.1.296, 2.1.299 and 2.1.300 on macOS.
- Fullscreen renderer (
"tui": "fullscreen"orCLAUDE_CODE_NO_FLICKER=1). - The pane both docked (150 columns) and inline (100 columns).
- Clicks sent as SGR mouse events in tmux.
Related
#100966 is the desktop app's version: there a pane Input never gets the keys.
_Written by Claude_