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

Re: zsh prompt not updating until first 'chdir'



In the last episode (May 01), Timothy J. Luoma said:
> Just back on the list after a long absence (exiled to Windows for a
> few years, just bought a Mac).

There is a very nice cygwin port of zsh :)

> I'm very rusty on my ZSH skills, and hope someone can help.  I have a
> $PROMPT setup in .zshenv
> 
> setprompt () { PROMPT="
> 
> ---------------------------------%t/%T ---------------------------------
> %S[OLDPWD: $OLDPWD]
>      [PWD: %~]%s
> $SHORT_HOST> "
> }

Why not just set PROMPT to  

"
---------------------------------%t/%T ---------------------------------
%S[OLDPWD: $dirstack[1]]
     [PWD: %~]%s
$SHORT_HOST> "

in your .zshrc directly, setopt prompt_subst, and forget about
resetting it every time you cd?

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



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