3 ms·
I love having stuff like this in zsh except that I very often have commands that don't exit with 0 either because I made a mistake, or because of something happ
by Y_Y 5y ago
I love having stuff like this in zsh except that I very often have commands that don't exit with 0 either because I made a mistake, or because of something happening like referencing a file that might have been there but wasn't.
I understand not wanting to clog up your history with typos, but some configs even default to not being able to press up-arrow to get a command that I just mistyped.
- capableweb 5y agoThe function lrobinovitch showed is not overwriting your history, it just shows the successful commands when running `jog`. Your up/down-arrow and ctrl+p will still work like normal, typos or not. But if you did do a mistake in your command, like referring to a file that doesn't exist, don't you rerun the command again but with the correct parameters? Then it would be included there as well (when running `jog`). Otherwise, it's trivial to remove the WHERE statement so it shows all the commands, seems zsh-histdb stores everything, successful or not.
- Y_Y 5y agoIndeed not. In fact the issue would be with some history never getting recorded at all. Thank you for clarifying though, that the dir-based history tools don't affect the existing history. The example I was trying to explain above referred to deliberately referencing a filename which may not correspond to an existing file. Like I might stat a file, to know when it was created, but if it hasn't been created yet then that's an answer too.