Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] prompt: support generic non-visible regions



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