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

Re: zsh prompt not updating until first 'chdir'



Timothy Luoma wrote:
> 
> > in your .zshrc directly, setopt prompt_subst, and forget about
> > resetting it every time you cd?
> 
> PROMPT="
> ---------------------------------%t/%T ---------------------------------
> %S[OLDPWD: $dirstack[1]]
>       [PWD: %~]%s
> $SHORT_HOST> "
> 
> works great EXCEPT that OLDPWD doesn't get updated

Use single quotes instead of double quotes (and don't forget the
prompt_subst option). With double quotes, the variables are expanded
straightaway which is why they don't update.

Oliver



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