Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] prompt: support generic non-visible regions
- X-seq: zsh-workers 50456
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>, Oliver Kiddle <opk@xxxxxxx>, dana <dana@xxxxxxx>
- Subject: Re: [PATCH] prompt: support generic non-visible regions
- Date: Thu, 11 Aug 2022 11:20:42 -0500
- Archived-at: <https://zsh.org/workers/50456>
- In-reply-to: <CAH+w=7am4mzUae3+YAuWgvPsugGUbUCJkFys5eNZ87MUTTtR6Q@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20220810115120.182853-1-felipe.contreras@gmail.com> <CAN=4vMqHNZJ7BvCCNbD7-0nPr1CbN1ecHQVxSsaZQ1Ao13__jg@mail.gmail.com> <CAH+w=7am4mzUae3+YAuWgvPsugGUbUCJkFys5eNZ87MUTTtR6Q@mail.gmail.com>
On Thu, Aug 11, 2022 at 10:21 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Thu, Aug 11, 2022, 9:38 AM Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
>>
>> I like this patch but for a different reason. It closes the capability
>> gap in zsh prompts with and without prompt_percent.
>
> I've been traveling this week without access to the source code so haven't otherwise commented on this, but:
>
> 1. Roman's point above is valid.
>
> 2. As previously mentioned by others, this is related to %{ %} rather than to %F, and should be implemented and documented as such. One cannot write $'\001red\002' (I presume) and it would not be generally useful in that context.
More related, yes, but %F does do the equivalent of %{%} internally (I
didn't know what %{%} did when I wrote the commit message).
For reference bash does have the equivalent of that with \[ \], but
that's specific to bash and it's converted to \001 \002 internally
which is what readline understands. A prompt function (like
__git_ps1()) cannot return \[ \].
> 3. Escapes for ctrl-a and ctrl-b also work? Or this is explicitly looking for \001 \002 ? Any possible conflicts?
^A ^B are another way to say \001 \002 is it not? Or \x01 \x02. At the
end of the day are the same values.
I don't know how to echo ^A in order to test though.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author