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

Unexpected behavior with prompt -p {prompt name}



Hello,
I've started a project to gather themes for Zsh that base on the
original Zshell prompt subsystem:

https://github.com/psprint/zprompts

i have problem with first theme added. I build prompt in following way:

    local _lpar="${cl_parens}["
    local _rpar="${cl_parens}]"

    local _time="$cl_time_line%D{%H:%M}"
    local _user="$cl_text%n"
    local _at="$cl_at_colon@$cl_text%m"
    local _path="$cl_at_colon:$cl_text%30<*<%/"
    local _line="$cl_time_line%i"
    local _prompt="$cl_prompt# "
    PS1="$_time$_lpar$_user$_at$_path$_rpar$_line$_prompt$cl_rst"

And it works fine, displaying:
10:38[sgniazdowski@MacMini:/Users/sgniazdowski]2#

However, prompt -p results in "]" being eaten, right after the path. I
tried adding various things after $_path, and they all get eaten.
Resulting in:

10:40[sgniazdowski@MacMini:*4# command arg1 arg2 ... argn

What is wrong with the line:

    local _path="$cl_at_colon:$cl_text%30<*<%/"

? $cl_* are just colors, the two are defined as:
    local col_text=${3:-'cyan'}
    local col_at_colon=${4:-'yellow'}
    local cl_text="%b%F{$col_text}"
    local cl_at_colon="%b%F{$col_at_colon}"

Best regards,
Sebastian Gniazdowski



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