Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate key input on Windows since v2.23.0 #203

Closed
TheNeverK opened this issue Dec 26, 2023 · 5 comments · Fixed by #204
Closed

Duplicate key input on Windows since v2.23.0 #203

TheNeverK opened this issue Dec 26, 2023 · 5 comments · Fixed by #204
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@TheNeverK
Copy link

Hi,
It seems that on Windows, every key press in interactive mode is duplicated.

I did some digging, and found that the bug was introduced between v2.22.0 and v2.23.0. I don't have my dev environment with me, so I can't point to an exact commit nor provide a fix right now. However, I've noticed that v2.23.0 swaps tui for ratatui and updates crosstermion to 0.12.0. This in turn bumps crossterm from 0.25.0 to 0.27.0. Version 0.26.0 seems to introduce a breaking change (or a bug?) in crossterm-rs/crossterm#745 (also described in crossterm-rs/crossterm#752).

It should be an easy fix (crossterm-rs/crossterm#752 (comment)), but I can't make a PR for the next few days, so I'm leaving an issue for now for anyone else who wants to fix it.

P.S. Happy Holidays to anyone who celebrates ;)

@Byron
Copy link
Owner

Byron commented Dec 26, 2023

Thanks for bringing this up!

I think here the fix will be a little more cumbersome to apply as I think event handling is done in crosstermion, requiring the fix there. On the bright side, it would be picked up automatically once a release was made.

I will take a look later.

@Byron Byron added the bug Something isn't working label Dec 26, 2023
Byron added a commit that referenced this issue Dec 26, 2023
On Windows, key-states like press/release/repeat are made available
separately, which means we should avoid responding to key-releases
as it would incorrectly double the actual user inputs.
@Byron Byron mentioned this issue Dec 26, 2023
2 tasks
@Byron
Copy link
Owner

Byron commented Dec 26, 2023

@TheNeverK I took a stab at it (see linked PR) and hoped you could take it for a spin so I can rightfully declare victory :D. If you don't mind, please specifically test the Mark pane by at least pretending to delete something. Thanks.

@Byron Byron added help wanted Extra attention is needed question Further information is requested labels Dec 26, 2023
@TheNeverK
Copy link
Author

@Byron Just tried it, works perfectly now :D I tested the mark pane, deleted some files, tried as many key inputs as I could think of and found no issues :D I also did a broader scan of a whole drive, just to be sure, and it matches my previous results, so I believe everything works correctly.

@gosuwachu
Copy link
Contributor

I can also confirm this fixes the issue after testing in Windows 11 VM.

@Byron
Copy link
Owner

Byron commented Dec 26, 2023

Great, thanks for your help and the very timely response! The fix is now official: https://github.com/Byron/dua-cli/releases/tag/v2.24.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants