3 ms·
I've done the same thing, and I've found it super helpful. My particular configuration is at https://github.com/YenTheFirst/dotfiles/blob/master/.bash_cd_hook.
by Yen 7y ago
I've done the same thing, and I've found it super helpful.
My particular configuration is at https://github.com/YenTheFirst/dotfiles/blob/master/.bash_cd_hook.sh https://github.com/YenTheFirst/dotfiles/blob/master/.bash_cd...
90% of the time, the bash history is super relevant to the current context. A small amount of the time, I remember that I issued a command, but not in which directory - in these cases, I can just search the history directory, and get both the context of what the command was, and also where I was when I originally issued it.
- chubot 7y agoThanks, reading over that code was useful. In particular I realized that my Oil project (a bash-compatible shell [1]) doesn't support PROMPT_COMMAND, which tons of people appear to be using. https://github.com/oilshell/oil/issues/320 https://github.com/oilshell/oil/issues/320 It seems like a weird hack but apparently it works for tons of things! [1] Latest status: Success With the Interactive Shell http://www.oilshell.org/blog/2019/02/05.html http://www.oilshell.org/blog/2019/02/05.html . Oil runs a bunch of interactive programs like bash-completion, virtualenv, and git-prompt.