Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] prompt: support generic non-visible regions
- X-seq: zsh-workers 50450
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx, Oliver Kiddle <opk@xxxxxxx>, dana <dana@xxxxxxx>
- Subject: Re: [PATCH] prompt: support generic non-visible regions
- Date: Wed, 10 Aug 2022 20:59:21 +0200
- Archived-at: <https://zsh.org/workers/50450>
- In-reply-to: <20220810115120.182853-1-felipe.contreras@gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20220810115120.182853-1-felipe.contreras@gmail.com>
On 8/10/22, Felipe Contreras <felipe.contreras@xxxxxxxxx> wrote:
> readline assumes anything between \001 (start of header) and \002 (start
> of text) is non-visible characters.
>
> In zsh we do this with `%F{color}`, but we could support
> `\001\e[31m\002` as well.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
> ---
>
> I don't know if this is the right way to do it, but in my limited
> testing it seems to work fine.
The commit message seems a bit confused, %F has nothing to do with
marking characters as 0-width, rather everything between %{ and %}
will be treated as such. You can use %{%} (or \001 and \002) to set
colors via the specific \e [ Ps m code, but also to send any other
codes handled by the terminal.
That aside, I don't really see a reason to add support for
bash-specific prompt sequences that are more cumbersome to use than
the already existing zsh ones. Bash prompts are already completely
incompatible anyway.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author