4 ms·
Undoing 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 some
by gpanders 5y ago
Undoing 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 5y agoNo need to be abstract and think of “theory”. Vim for example has undo.
- hsitz 5y 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 5y agoIt's been 50 years. Why doesn't bash in a friendly system like Ubuntu have undo for mv.
- calvinmorrison 5y agoalias undo=mv $2 $1
- dyingkneepad 5y agoDoesn't work if the first move overwrote a file, or if $2 is a directory.
- anthk 5y agoBecause that's not bash' job.
- aidenn0 5y agoYou can't undo a file-move in (most?) GUI file managers either.
- inb4_cancelled 5y agomacOS and AFAIK Windows have that
- d110af5ccf 5y 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 5y 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 5y agoYeah there are definitely a lot of edge cases when it comes to filesystem operations. It works for the simple stuff though (ex accidentally grabbing the wrong file or dropping it in the wrong folder). I mostly just use Ranger in a VTE to be honest. Cut/Copy/Paste and directional navigation of a tree using standard Vim keybindings is just more fluid than anything with a mouse could ever hope to achieve. Add to that dropping to the shell with `S` with my hands already on the keyboard and it's by far the best workflow I've come across.
- aidenn0 5y agoRanger is great; I do wish it had the ability to have windows rather than just tabs; it would be easy enough to setup an orthodox style view if that were the case.
- sellyme 5y 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.