(You can skip the stuff wrapping virtualenv, obviously.)
Basically just define a function that does the write, set HISTFILE, read, and then elsewhere alias cd=mycd.
If anyone gives it a try, I'd love to hear how it works! I think it needs some tweaks -- for example, multiple terminals in the same directory are probably clobbering each other -- looks like this 'shopt -s histappend' would help with that.
https://github.com/aaronharnly/dotfiles-public/blob/master/....
(You can skip the stuff wrapping virtualenv, obviously.)
Basically just define a function that does the write, set HISTFILE, read, and then elsewhere alias cd=mycd.
If anyone gives it a try, I'd love to hear how it works! I think it needs some tweaks -- for example, multiple terminals in the same directory are probably clobbering each other -- looks like this 'shopt -s histappend' would help with that.