Skip to content

fix(spectatui): ignore key-release events on Windows - #4

Merged
tinesoft merged 1 commit into
tinesoft:developfrom
FrancescoCoding:fix/windows-duplicate-key-events
Jul 10, 2026
Merged

fix(spectatui): ignore key-release events on Windows#4
tinesoft merged 1 commit into
tinesoft:developfrom
FrancescoCoding:fix/windows-duplicate-key-events

Conversation

@FrancescoCoding

Copy link
Copy Markdown
Contributor

Fix: Confirm dialogs instantly dismissed on Windows

Symptom: On Windows, pressing a key that opens a confirmation dialog (e.g. q → "Quit Spectatui?") dismisses it in the same keystroke. The user never gets to interact with it. Also affects the CLI confirm dialog.

Cause: crossterm 0.28 emits a KeyEvent for both key press and key release on Windows. The event loop in event.rs forwarded both, so the release event was handled a second time by the newly-opened dialog's key bindings.

Fix: Filter incoming key events to KeyEventKind::Press at the source. Linux/macOS only ever emit Press, so this is a no-op there and safe cross-platform.

@tinesoft

tinesoft commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Thanks for using spectatui and for your fix!

can you please edit the commit message as such:

fix: fix confirm dialogs instantly dismissed on Windows

it will be used for the changelog.

Thanks

@FrancescoCoding
FrancescoCoding force-pushed the fix/windows-duplicate-key-events branch from 1facb5b to cdf32ce Compare July 8, 2026 22:33
@FrancescoCoding

Copy link
Copy Markdown
Contributor Author

No worries @tinesoft, done!

@tinesoft

tinesoft commented Jul 9, 2026

Copy link
Copy Markdown
Owner

The commit sub-text (body) is too long ( see https://github.com/tinesoft/spectatui/actions/runs/28980387189/job/86064256299)

Can you please remove it from the commit and just keep the first line as mentioned above.

fix: fix confirm dialogs instantly dismissed on Windows

@FrancescoCoding
FrancescoCoding force-pushed the fix/windows-duplicate-key-events branch from cdf32ce to c1faaa2 Compare July 9, 2026 17:41
@FrancescoCoding

Copy link
Copy Markdown
Contributor Author

Oh, right. Sorry had misunderstood 😅

@tinesoft
tinesoft merged commit 79b4170 into tinesoft:develop Jul 10, 2026
2 of 6 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