Closed sadid closed 5 years ago
@sadid Thanks for the input, so nice to get our first user feedback.
I had something similar in mind. Was also thinking d
for a delete confirmation dialogue (in the information bar at the bottom), D
for force delete. This has only very recently come into scope with the new interactive command bar functionality, so we'll look at this soon. For now, please be careful with your images, and I'm sorry if you lost anything important.
I just want to emphasis that I love the no-confirmation approach. Personally, I prefer the folder approach (like 'keep' a 'delete' folder for example), since I usually call riv from my ranger rifle and working with directory is easy. This way it integrate better with my vim/ranger/riv workflow.
Moreover, I want to thank you for your software. It's inspiring and I like to use it more. Also no loss, I was just testing it.
@sadid, I think if I was going with a folder approach, I would use the ~/.Trash
on mac, $recycle_bin
on windows, and then whatever we have on linux (probably 101 different possibilities).
@Davejkane Not sure what to do for Windows trash support without adding winapi-rs as a crate dependency. as it is not a path, but a "VIRTUAL" folder.
deleting a file for Windows 8+ Though, we need to somehow set the OperationFlags to only trash the file
There doesn't appear to be a cross platform "move to trash" feature provided by a crate that I could find.
dirs
or directory-rs
https://github.com/soc/directories-rs/issues/18
@gurgalex, that's a little disappointing, but thanks for looking into it. Will be an interesting challenge.
After reading into this https://github.com/nivekuil/rip, I think our solution should be threefold.
$RIVTRASH
environment variable or something~/.Trash
Doesn't seem quite as simple for Linux as I thought.
Need to correctly handle trashing a file. https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html
As someone may want to restore it.
MacOS requires finding the right bindings for trash operations. I don't have a Mac, so we'll see how much work can be done with no testing.
Windows is slightly easier as I have the machine to test on.
@gurgalex do you want to take this one? If all of this is too much hassle we could just follow the same as above, but with just a regular directory as the os specific path.
So cascading importance would be cli arg > env var > default path (os specific)
.
If you don't want it, I don't mind taking it.
@Davejkane I'll work on this (or parts of it) depending on what we go with.
If we go with having our own default directory, we'll need a way for the program to restore the files to the location they were moved from. Which I'll probably go with the freedesktop.org trash spec, as they say it can work across platforms.
If we go with native trash support, I can do linux and Windows. I'll need you to implement the trash support for Mac OS.
@Davejkane I've got an initial draft for OS specific trash support (linux only so far)
This can be pushed to when implementing Mac OS trash support.
Closed by #93
While I love the vim style and the uninterrupted/fast deletion procedure of
riv
by 'd' (very convenient), however this behavior makesriv
not safe for me. Because, just by even one accidental press of d, the image will be removed (byrm
?) and this is a bit worrisome for me.I think, if
d
(orD
) remove the image in the same procedure but:keep
) and move the image therewould be much better