zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Unexpected behavior with prompt -p {prompt name}
Date: Sat, 4 Jun 2016 10:42:36 +0200	[thread overview]
Message-ID: <CAKc7PVD1ETj8=32XEvj_gm+EGLDE3pNfK+Luocd3p=O8F6Fxkw@mail.gmail.com> (raw)

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


             reply	other threads:[~2016-06-04  8:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-04  8:42 Sebastian Gniazdowski [this message]
2016-06-04 12:49 ` Sebastian Gniazdowski
2016-06-04 17:07   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKc7PVD1ETj8=32XEvj_gm+EGLDE3pNfK+Luocd3p=O8F6Fxkw@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).