Byron / dua-cli

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

Dangerous CTRL+r hotkey #248

Open ayykamp opened 1 week ago

ayykamp commented 1 week ago

image I have a small UX suggestion. In most applications (web browsers, file browser, smth like baobab) CTRL+r reloads the current view. In dua however, it permanently deletes without prompt 🥶 (assuming you have files selected).

Maybe a hotkey like DEL or SHIFT+DEL would be more intuitive.

Anyways thanks for the great utility I use it all the time :)

Byron commented 1 week ago

Thanks for sharing your concerns.

I have recorded how it looks like to select something in dua and that panes have to be changed (using tab) to make Ctrl+r function. The UI will turn red to further indicate danger, with a red and blinking note on which combination to press.

https://github.com/Byron/dua-cli/assets/63622/5d817b74-811e-4a80-ada4-2b64849dfd50

Ctrl+r is supposed to be related to r.emove, hence the letter. As certain hotkey combinations aren't reliably working in terminals, simple hotkey combinations have to do. It would be possible to add shift to the mix though to make any kind of unintended muscle memory harder.

That would make it Ctrl+Shift+R, or Ctrl+R on the help page which is shown above.

If you think that would work, then a PR is very welcome.

ForsakenHarmony commented 6 days ago

I've accidentally deleted a directory by pressing ctrl+r in the normal view, it does not seem to be constrained to the "Mark entries" pane.

There should at least be some kind of confirmation if it's enabled in the tree tab

Byron commented 6 days ago

I am sorry to hear that.

Which version are you using? I cannot reproduce this with the latest one.