My RPROMPT is set to display svn info using vcs_info. It reads RPROMPT=${vcs_info_msg_0_}. vcs_info is called using precmd(). However, RPROMPT doesn't update when I change directories. It works only if I invoke the prompt again (either by source ~/.zshrc or prompt ) and doesn't change upon chdir, unless I invoke the prompt again. Is there any way to change this behaviour?
|
|
|||
|
|
migrated from stackoverflow.com Jun 2 '11 at 19:06
|
Try putting single quotes around the variable value at assignment to delay evaluation:
|
|||||||
|
|
Using a single-quote to delay evaluation works for defining dynamic aliases as well. Here's an alias,
That definition of
Note the expansion of the definition of |
|||
|
|
