Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Help fix Zsh shell command prompt error or stranee
- X-seq: zsh-users 29176
- From: Grant Taylor <gtaylor@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Help fix Zsh shell command prompt error or stranee
- Date: Sun, 20 Aug 2023 10:54:58 -0500
- Archived-at: <https://zsh.org/users/29176>
- In-reply-to: <CAN=4vMpzOYiUkYUgJdS7X8puHfQoYVZk_30A=mPa68N1K=fd_Q@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAH0GyZCa=FeguBvWAEMwjRkQn+mAhtJbjKaUr3Qkzfp5vPZjzQ@mail.gmail.com> <ad36472f-f2af-5962-af57-52eeab643cde@tnetconsulting.net> <CAN=4vMpzOYiUkYUgJdS7X8puHfQoYVZk_30A=mPa68N1K=fd_Q@mail.gmail.com>
On 8/20/23 1:30 AM, Roman Perepelitsa wrote:
In the vast majority of cases one can replace %{...%} with a
first-class %-sequence.
I question the "vast" quantifier.
For example, instead of %{\033[31m%} one canuse %F{red}.
Zsh has many SIMPLE PROMPT ESCAPES and CONDITIONAL SUBSTRINGS IN PROMPTS
-- see zshmisc and / or zshall manual pages. But they all seem to be
specific to what appears on the prompt line(s).
This starts falling apart when you print terminal control characters /
escape sequences used to alter the terminal window title or re-define
the default terminal background / foreground colors and / or resize /
reposition the terminal window itself.
N.B. there is very much so a difference in re-defining the terminal's
current default vs specifying colors in the actual output.
Zsh has the most feature rich prompt support that I remember seeing.
But even that doesn't cover all the things that I do. Hence why Zsh
includes the %{...$} and even the %G to alter how Zsh does or doesn't
count characters output to the terminal.
Grant. . . .
Messages sorted by:
Reverse Date,
Date,
Thread,
Author