Open jelly opened 5 months ago
IMHO we should model this after graphical file browsers like nautilus or pcmanfm. The CLI has different "oopsie" vectors, such as rm myfile. *
(note the very significant space!)
cp -a ~/upstream/starter-kit/ /tmp/
Trying to remove /tmp/starter-kit in pcmanfm doesn't ask me for any special confirmation. If I select a directory and say "delete", it does that. Of course GNOME etc. default to moving it to the trash. Maybe that's not a bad idea in cockpit-files either? And adding an equivalent to shift-delete?
2¢: I don't think we need to ask for special permission to delete git checkouts. The fact that rm
does this is simply a side-effect of the fact that git marks its object files readonly. I've always considered it to be a weird filesystem limitation that there wasn't a better way to mark an inode immutable but otherwise completely normal from a permissions standpoint. I consider the fact that rm -r
happens to prompt on git checkout to be a weird side-effect... and indeed, if you do rm -r
on a git repository, chances are it's going to delete a bunch of files before it gets to the object db where it will prompt you...
As for the trash: implementing the XDG trash spec might be interesting, but probably a lot of work... I did the gvfs/gio work for that back in the day and it's pretty non-trivial....
Files behaviour on removing directories is different from the CLI experience:
For example trying to delete a git checkout warns about write protected files:
In files the directory is removed without any warning.
Normally one would have to pass
-f
to remove such directory see the man page:What should Files do here, replicate
rm
's command line behaviour or not?