Commit fc9bf49
authored
fix(windows): handle spurious key events in command picker (voidzero-dev#1100)
## Problem
On Windows, running `vp` directly in Windows Terminal (PowerShell or
CMD) causes the command picker to immediately receive an Enter key
Release event, which incorrectly triggers the `create` subcommand
without user input. This issue does **not** occur in VS Code Terminal.

Additionally, when running under `conhost.exe`, user input characters
are duplicated.

## Root Cause
This is caused by a known Windows Terminal issue that key events are
generated simultaneously.
## Fix
Check `KeyEventKind` before `handle_key_event`
## Related Issues
microsoft/terminal#8440
crossterm-rs/crossterm#9781 parent c75d8df commit fc9bf49
1 file changed
+22
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
216 | 220 | | |
217 | | - | |
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| |||
0 commit comments