Byron / dua-cli

View disk space usage and delete unwanted data, fast.
https://lib.rs/crates/dua-cli
MIT License
4.19k stars 113 forks source link

Duplicate key input on Windows since v2.23.0 #203

Closed TheNeverK closed 11 months ago

TheNeverK commented 11 months ago

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 https://github.com/crossterm-rs/crossterm/pull/745 (also described in https://github.com/crossterm-rs/crossterm/issues/752).

It should be an easy fix (https://github.com/crossterm-rs/crossterm/issues/752#issuecomment-1414909095), 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 commented 11 months ago

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 commented 11 months ago

@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.

TheNeverK commented 11 months ago

@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 commented 11 months ago

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

Byron commented 11 months ago

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