Hacker News new | ask | show | jobs
by Arnavion 3715 days ago
>Windows gets this right: By default, files are not deleted, but moved to trash.

The del or Remove-Item commands also permanently delete the file, just like rm. The "Windows" behavior you're talking about is the behavior of the graphical shell Explorer, which is also present in Gnome and KDE. There's nothing specific to Windows here.

3 comments

  apt install trash-cli
  alias rm=trash
Done? This implements the Freedesktop specification, so is compatible with what KDE and Gnome do.

https://github.com/andreafrancia/trash-cli

You are right, I forgot about Gnome and KDE. I tend to use classic shells on Linux, and the graphical shell on Windows, so I made a wrong generalization. It's probably more accurate to say that "undo" of simple operations (rm, mv) is something graphical shells get right.

But why are classic shells shipped without even the simplest "undo" features? We can probably all tell stories-from-the-trenches of how we accidentally did something aweful by typing the wrong command. Sometimes, it's hosing the network configuration of a remote machine, which is not something where "undo" would help you. However, in my experience, most cases involve doing something foolish with rm or mv, where "undo" would be tremendously helpful. I guess the main reason why I don't use the text shells of Windows is that Windows explorer gives me Ctrl+Z, which is saving my behind approximately once per year.

As a final thought, all shells (graphical or not) should expand the undo-features beyond rm and mv. For example, if I change system settings (or even Application settings?) and am not happy, I would love to be able to simply "undo" them, without trying to remember what the previous setting was. I realize that this is an incredibly hard problem, and that it is unlikely to be solved in an evolutionary step of the existing shells. That's why hearing about NGS got me so excited.

> But why are classic shells shipped without even the simplest "undo" features?

This question is assuming an untrue premise. There are Windows command interpreters that integrate DEL and RD with the Recycle Bin.

* https://jpsoft.com./help/del.htm#r

* https://jpsoft.com./help/del.htm#k

* https://jpsoft.com./help/rd.htm#r

* https://jpsoft.com./help/rd.htm#k

That said, i'd like a "del to recycle bin" in Windows too.
Then get yourself off to https://jpsoft.com/ , set the Delete To Recycle Bin option on in the configuration tool (https://jpsoft.com./help/inistartupdlg.htm), and enjoy exactly that. (-: