30 ms·
I always respect when people take the time to put a small but useful thing like this up in a repo by itself. It has always been a frustration that the current
by kbd 5y ago
I always respect when people take the time to put a small but useful thing like this up in a repo by itself.
It has always been a frustration that the current working directory metadata isn't saved along with history entries, so you can never really reconstruct what was run.
Edit: I should really try out https://github.com/larkery/zsh-histdb https://github.com/larkery/zsh-histdb. There's no reason a modern system's history shouldn't store start and finish timestamps, return code, current working directory, etc.
- WD-42 5y ago> It has always been a frustration that the current working directory metadata isn't saved along with history entries, so you can never really reconstruct what was run. It is if you use fish shell.
- drcongo 5y agoI'm a Fish inside Iterm2 user, constantly with a four panel split screen, and I'm always slightly amazed that _something_ seems to even remember which pane I ran various commands in. I have no idea which is remembering though.
- visarga 5y ago> It has always been a frustration that the current working directory metadata isn't saved along with history entries, so you can never really reconstruct what was run. And git branch if applicable.
- version_five 5y agoYes, underrated idea. I recently kept a spreadsheet of commands I'd ran, which branch, and where the output went. It would be great to see this tracked.
- visarga 5y agoI keep shell sessions logged to individual files, collected for years back. I often reuse past commands. But if the command run from a git folder it's hard to tell which branch. It's also important to use full path names.
- kortex 5y agoZsh-histdb is one of my absolute lifesavers. It's literally the first thing I install on new systems, after zsh itself and oh-my-zsh. I could never go back to working without it.
- arthurcolle 5y agoThanks I'll check this out! Any other useful zsh plugins you want to call out? It's been my favorite shell for a while mostly because of OMZ but always interested in some new magic!
- da39a3ee 5y agoDo you know how zsh-histdb compares to similar projects?(quick google…) https://github.com/cantino/mcfly https://github.com/cantino/mcfly https://github.com/ellie/atuin https://github.com/ellie/atuin https://loshadki.app/shellhistory/ https://loshadki.app/shellhistory/ https://github.com/AlexanderThaller/hstdb https://github.com/AlexanderThaller/hstdb https://github.com/larkery/zsh-histdb https://github.com/larkery/zsh-histdb
- ngngngng 5y ago> It has always been a frustration that the current working directory metadata isn't saved along with history entries Agreed. Wild that's not built in at this point.
- simias 5y agoThat's a cool idea. I have a similar, but less elegant setup: I just append every single command that I type to a global (synchronized between machines) history file, one file per month, then I use fzf to search through these when I need something (which is plugged into the usual ^R shell binding). Every command I've typed over the past couple of years is accessible immediately that way. It's not scoped by directory though, but I'm not sure I'd personally need that feature.
- usrusr 5y agoCame here to write something along the lines of "useless for me, because I hardly ever use cd at all in order to get a history containing lots of useful full path references". But you're right, something modern could be far more elegant. (but it won't happen, these days it's crazy rare to "dig in" in a dazzlingly customized environment, we'd rather tweak our skills to work on the widest range of default environments. Certainly not the best conditions for innovation)
- kbd 5y ago> these days it's crazy rare to "dig in" in a dazzlingly customized environment Speak for yourself. The time I spend working locally is vastly more than I spend ssh-ing into somewhere vanilla so it's worth making my environment as comfortable and full-featured as possible. Edit: > I hardly ever use cd… to get a history [with] path references That’s one way of solving the problem, but then you miss out on great tools like direnv… and relative paths.