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

Dangerous CTRL+r hotkey #248

Open
ayykamp opened this issue Jun 26, 2024 · 5 comments
Open

Dangerous CTRL+r hotkey #248

ayykamp opened this issue Jun 26, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@ayykamp
Copy link

ayykamp commented Jun 26, 2024

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
Copy link
Owner

Byron commented Jun 26, 2024

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.

Screen.Recording.2024-06-26.at.13.18.54.mov

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.

@Byron Byron added enhancement New feature or request help wanted Extra attention is needed labels Jun 26, 2024
@ForsakenHarmony
Copy link

ForsakenHarmony commented Jun 27, 2024

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
Copy link
Owner

Byron commented Jun 27, 2024

I am sorry to hear that.

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

@Byron Byron added the question Further information is requested label Jun 27, 2024
@siddhpant
Copy link

There should be a configuration to disallow deletion.

For example, for ncdu we can have:

$ cat /etc/ncdu.conf 
# Do not allow any modifications to the filesystem.
--disable-delete
--disable-shell

@Byron
Copy link
Owner

Byron commented Aug 20, 2024

There could be a read-only/browse-only mode, by passing an additional flag maybe. Of course that wouldn't necessarily prevent accidents accept for the most cautious users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants