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

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



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