zsh-users
 help / color / mirror / code / Atom feed
From: Grant Taylor <gtaylor@tnetconsulting.net>
To: zsh-users@zsh.org
Subject: Re: Help fix Zsh shell command prompt error or stranee
Date: Sun, 20 Aug 2023 10:54:58 -0500	[thread overview]
Message-ID: <b2adb205-073e-c72f-f4fd-3925e8ab44eb@tnetconsulting.net> (raw)
In-Reply-To: <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. . . .


  parent reply	other threads:[~2023-08-21 23:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-19  0:35 Budi
2023-08-19  2:01 ` Grant Taylor
2023-08-20  6:30   ` Roman Perepelitsa
2023-08-20 10:50     ` Budi
2023-08-20 17:11       ` Bart Schaefer
2023-08-20 15:54     ` Grant Taylor [this message]
2023-08-22  6:26       ` Roman Perepelitsa
2023-08-23  4:27         ` Grant Taylor
2023-08-19 16:09 ` 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=b2adb205-073e-c72f-f4fd-3925e8ab44eb@tnetconsulting.net \
    --to=gtaylor@tnetconsulting.net \
    --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).