From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Marlon Richert <marlon.richert@gmail.com>,
Roman Perepelitsa <roman.perepelitsa@gmail.com>,
Zsh Users <zsh-users@zsh.org>
Subject: Re: Why are prompt expansions of %v sequences quoted in bindkey style?
Date: Tue, 23 Jan 2024 21:21:44 +0100 [thread overview]
Message-ID: <CAHYJk3R8cpPSrNQOk8tnwz6bVYFVTfpJHz_DeFiYmCKHu880_Q@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Z1B1f_Ut1xkog2nP4YXBjRhXscMTdkzD8+uANmnAbzQg@mail.gmail.com>
On 1/23/24, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Tue, Jan 23, 2024 at 10:44 AM Marlon Richert
> <marlon.richert@gmail.com> wrote:
>>
>> However, the quoting seems to make it impossible to use $psvar for
>> anything involving control characters.
>
> That's correct. Anything involving control characters would also
> require %{...%} or %G to specify the occupied screen width.
>
>> Is there no way to work around this?
>
> As Roman mentioned, the usual way is to use precmd to update prompt values.
fwiw, you can do things like %F{%5v}hello or %(3V.%B.) to make things
dynamic without using promptsubst or updating PS1 in precmd, but you
do have to have all the actual formatting in PS1 then.
--
Mikael Magnusson
next prev parent reply other threads:[~2024-01-23 20:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 11:03 Marlon Richert
2024-01-23 13:05 ` Roman Perepelitsa
2024-01-23 18:43 ` Marlon Richert
2024-01-23 18:55 ` Roman Perepelitsa
2024-01-23 19:15 ` Bart Schaefer
2024-01-23 20:21 ` Mikael Magnusson [this message]
2024-01-24 5:45 ` Marlon Richert
2024-01-24 8:53 ` Mikael Magnusson
2024-01-24 13:37 ` Marlon Richert
2024-01-24 19:35 ` Mikael Magnusson
2024-01-25 8:42 ` Marlon Richert
2024-01-25 9:20 ` Lawrence Velázquez
2024-01-25 16:16 ` Mikael Magnusson
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=CAHYJk3R8cpPSrNQOk8tnwz6bVYFVTfpJHz_DeFiYmCKHu880_Q@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=marlon.richert@gmail.com \
--cc=roman.perepelitsa@gmail.com \
--cc=schaefer@brasslantern.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).