fix(spectatui): ignore key-release events on Windows - #4
Merged
tinesoft merged 1 commit intoJul 10, 2026
Merged
Conversation
Owner
|
Thanks for using 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
force-pushed
the
fix/windows-duplicate-key-events
branch
from
July 8, 2026 22:33
1facb5b to
cdf32ce
Compare
Contributor
Author
|
No worries @tinesoft, done! |
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.
|
FrancescoCoding
force-pushed
the
fix/windows-duplicate-key-events
branch
from
July 9, 2026 17:41
cdf32ce to
c1faaa2
Compare
Contributor
Author
|
Oh, right. Sorry had misunderstood 😅 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.