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

Re: How to stop dir expansion in the prompt?



On Nov 4,  2:30pm, Shiyao Ma wrote:
}
} To replace $HOME with ~, I do this:
} PROMPT="%(?.${success_color}.${failure_color})${SSH_TTY:+[%n@%m]}%B%${max_path_chars}<...<"'${${vcs_info_msg_0_%%}/#$HOME/~}'"%<<%(!.${root_char}.${user_char})%b%f
} "
} 
} Where am I doing wrong?

/#$HOME/ means the pattern has to match at the start of the string.
Are you sure the value of $vcs_info_msg_0_ starts with the directory
name?  Also, why is the %% in the inner expansion?  (I guess it was in
your original example too, but it's extraneous if there's nothing
between it and the closing brace.)

} (Does zsh support nested variable expansion?)

Yes.



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