You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Allow interrupt (Ctrl+C) in ChatInput when no text selected (#405)
## Problem
Currently, `Ctrl+C` (or `Cmd+C` on Mac) to interrupt the stream only
works when focus is outside editable elements. This means users cannot
interrupt while ChatInput is focused, requiring them to click elsewhere
first.
## Solution
Modified the interrupt handler in `useAIViewKeybinds` to check for text
selection:
- **No selection** → Interrupt stream (allows interrupting from
ChatInput)
- **Has selection** → Browser handles copy (preserves existing behavior)
The logic now allows interrupt in editable elements as long as there's
no active text selection, preventing conflict with the copy keybind.
## Changes
- Updated `useAIViewKeybinds.ts` interrupt handler to check
`window.getSelection()`
- When in editable element with no selection: prevent default and
interrupt
- When in editable element with selection: let browser handle copy
## Testing
Manual testing scenarios:
- ChatInput focused, no selection, Ctrl+C → should interrupt ✅
- ChatInput focused, text selected, Ctrl+C → should copy text ✅
- Other input focused, no selection, Ctrl+C → should interrupt ✅
- Not in input, Ctrl+C → should interrupt ✅
_Generated with `cmux`_
0 commit comments