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

Somehow my prompt broke in 5.2



I'm trying to understand why the current directory is missing from my
(left) prompt string in 5.2 but appears just fine in 5.1.1 and earlier.

Here is a minimal .zshrc which shows the problem:

-----
setopt Prompt_Subst
autoload -Uz vcs_info

function precmd {
    vcs_info 'prompt'
}

zstyle ':vcs_info:*:prompt:*' nvcsformats "" "%~"

function lprompt {
    local vcs='${vcs_info_msg_1_/$HOME/~}'
    PROMPT="%m:${vcs}> "
}

lprompt
-----

On 5.1.1 I see something like:

  foo:~>

but on 5.2 I just get:

  foo:>

However, if I change lprompt to:

function lprompt {
    PROMPT="%m:${vcs_info_msg_1_/$HOME/~}> "
}
  
(or just dispense with the function and set PROMPT directly) then 5.1.1
behaves the same way as 5.2.  I don't understand what's different about
these two cases.

Now, I can't really recall why I set things up this way; I've had it for
years and obviously copied it from somewhere without really
understanding it and then did my own tweaking over time.  I will work on
another way of doing it, but I'd still like to know what's changed in
5.2 to cause this to stop working.  (I didn't see anything relevant in
the release notes.)

 - J<



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