Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why are prompt expansions of %v sequences quoted in bindkey style?
- X-seq: zsh-users 29549
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Marlon Richert <marlon.richert@xxxxxxxxx>, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Why are prompt expansions of %v sequences quoted in bindkey style?
- Date: Tue, 23 Jan 2024 21:21:44 +0100
- Archived-at: <https://zsh.org/users/29549>
- In-reply-to: <CAH+w=7Z1B1f_Ut1xkog2nP4YXBjRhXscMTdkzD8+uANmnAbzQg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAN=4vMoUnO=v3tWyY3+4ixMEfu_8_bC+c_KEOVCoLK7QH4Kogw@mail.gmail.com> <93F17F14-8DF3-4D02-875F-A7BAE9BA6427@gmail.com> <CAH+w=7Z1B1f_Ut1xkog2nP4YXBjRhXscMTdkzD8+uANmnAbzQg@mail.gmail.com>
On 1/23/24, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Tue, Jan 23, 2024 at 10:44 AM Marlon Richert
> <marlon.richert@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author