Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: persistant Directory history?



 >> Sorry to hijack, but is there a simple way to have a shared directory
>> stack between several terminal sessions?  I hacked together something
>> that
>> works, but I have a bad feeling that I reinvented the wheel (and never
>> quite made it round).
> [...]
>
> Maybe something like:
>
> SAVED_DIRSTACK=~/.zsh-dir-stack-shared
> get_saved_dirstack() {
>   [[ -r $SAVED_DIRSTACK ]] &&
>     . $SAVED_DIRSTACK
> }
> save_dirstack() {
>   print -r "dirstack=(${(@qq)dirstack})" > $SAVED_DIRSTACK
> }
>
> functions[preexec]+='
>   get_saved_dirstack'
> functions[chpwd]+='
>   save_dirstack'
>
> (untested).
>
> --
> Stéphane
>

Thanks.  That is similar enough to what I have to not make me feel like a
complete fool, but much more simple and elegant.

Bill

I'd show what I have but the server just kicked the bucket.



Messages sorted by: Reverse Date, Date, Thread, Author