jimhester / per-directory-history

Per directory history for zsh, as well as global history, and the ability to toggle between them with ^G.
zlib License
251 stars 36 forks source link

Doesn't use directory history for initial shell directory #5

Closed felixbuenemann closed 4 years ago

felixbuenemann commented 10 years ago

I've got my term setup so it cds to the directory of the previous window I was in, when I open a new window. But if I open a new window it's directory history doesn't contain the commands typed in the previous window. If I run _per-directory-history-change-directory manually, the proper directory history is used. It also used if I cd to another directory and back.

Not sure why it isn't working, I have eg. a preexec function that modifies the path if some files are present in the pwd and it's working properly. I'm using the most recent version of oh-my-zsh.

$ zsh --version
zsh 5.0.2 (x86_64-apple-darwin13.0)
$ setopt
alwaystoend
autocd
autonamedirs
autopushd
cdablevars
completeinword
extendedhistory
noflowcontrol
histexpiredupsfirst
histignoredups
histignorespace
histverify
incappendhistory
interactive
login
longlistjobs
monitor
promptsubst
pushdignoredups
pushdminus
sharehistory
shinstdin
zle
CyberShadow commented 4 years ago

I've had similar issues with share_history, which I solved by switching to a different approach at implementing this plugin: https://github.com/CyberShadow/per-directory-history/commit/b8e7a9644f5c89562a08e36eede577e8a8081eca

melecpetitpierre commented 4 years ago

I have the same problem, did you solve your problem ?

smarsching commented 4 years ago

@felixbuenemann @melecpetitpierre I made a PR for oh-my-zsh with a patch that solves the problem for me. If you are still experiencing this problem, you might want to take a look: https://github.com/ohmyzsh/ohmyzsh/pull/9008