Commit a8c2ad5
authored
🤖 fix: vim-aware interrupt keybinds (Ctrl+C in vim, Esc otherwise) (#562)
Changed interrupt stream keybind strategy to be vim-mode aware:
- **Vim mode enabled**: Ctrl+C (always interrupts, regardless of text
selection)
- **Vim mode disabled**: Esc (intuitive cancel/stop key)
This provides the most natural behavior for each mode while avoiding
conflicts with standard operations.
## Vim Mode Behavior
In vim mode, **Ctrl+C always interrupts streams** - consistent with vim
philosophy:
- Ctrl+C is for canceling/interrupting (like in terminal)
- Standard Ctrl+C copy is **not available** in vim mode
- Use vim yank commands (`y`, `yy`, `yiw`, etc.) for copying instead
- Provides consistent interrupt behavior whether text is selected or not
## Non-Vim Mode Behavior
In non-vim mode:
- **Esc** interrupts streams (intuitive cancel key)
- **Ctrl+C** works normally for copy operations
- Simple and predictable behavior
## Changes
- Split `INTERRUPT_STREAM` into `INTERRUPT_STREAM_VIM` and
`INTERRUPT_STREAM_NORMAL`
- Updated `useAIViewKeybinds` to accept `vimEnabled` and select
appropriate keybind
- Removed text selection checking in vim mode - Ctrl+C always interrupts
- Updated all UI components to display the correct keybind hint
- Updated documentation in `docs/vim-mode.md`
_Generated with `cmux`_1 parent 2c5a41f commit a8c2ad5
File tree
6 files changed
+54
-38
lines changed- docs
- src
- components
- Messages
- hooks
- utils/ui
6 files changed
+54
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
| |||
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
262 | | - | |
| 266 | + | |
263 | 267 | | |
264 | 268 | | |
265 | 269 | | |
| |||
416 | 420 | | |
417 | 421 | | |
418 | 422 | | |
419 | | - | |
420 | | - | |
| 423 | + | |
| 424 | + | |
421 | 425 | | |
422 | 426 | | |
423 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
| 757 | + | |
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
781 | | - | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
782 | 785 | | |
783 | 786 | | |
784 | 787 | | |
785 | 788 | | |
786 | 789 | | |
787 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
788 | 794 | | |
789 | 795 | | |
790 | 796 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
55 | 64 | | |
56 | | - | |
57 | | - | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
89 | 82 | | |
90 | 83 | | |
91 | 84 | | |
92 | 85 | | |
93 | 86 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 87 | | |
98 | 88 | | |
99 | 89 | | |
| |||
184 | 174 | | |
185 | 175 | | |
186 | 176 | | |
| 177 | + | |
187 | 178 | | |
188 | 179 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
| |||
0 commit comments