Skip to content

fix(windows): handle spurious key events in command picker#1100

Merged
fengmk2 merged 3 commits intovoidzero-dev:mainfrom
nekomoyi:fix/windows-key-event-dup
Mar 23, 2026
Merged

fix(windows): handle spurious key events in command picker#1100
fengmk2 merged 3 commits intovoidzero-dev:mainfrom
nekomoyi:fix/windows-key-event-dup

Conversation

@nekomoyi
Copy link
Contributor

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.

PowerShell

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

conhost

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#978

On Windows CMD/PowerShell, crossterm sends both Press and Release events
for each keystroke, which caused the picker to immediately select the
first option when launched. This change filters to only handle
KeyEventKind::Press events, ignoring Release events.
@netlify
Copy link

netlify bot commented Mar 22, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 7093071
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69c0d29ccca8340008b56eb4

@fengmk2 fengmk2 merged commit fc9bf49 into voidzero-dev:main Mar 23, 2026
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants