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

Re: highlight test cases (was Re: [BUG?] If true-color is used, overlapping colors do not work)



On Mon, 10 Dec 2018 at 03:54, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>
> On 30 Nov, Sebastian Gniazdowski wrote:
> > The output doesn't follow zsh_highlight replacements for start-code
> > and end-code and still emits raw codes.
> >
> > Could this be fixed?
>
> That was intentional. As I stated in 43759 which was the message
> including the true color patch:
>
> | The actual escape sequences appear to be quite standard and are, for
> | now, hard coded. We should probably support some zle_highlight fields
> | similar to fg_start_code to allow them to be configured but I'm unsure
> | of what exact form that should take.

That said, not everything was hard-coded – zle_highlight was respected
by the true color patch.

> it is always better to be using termcap if possible - contrary to your
> change in 43875.

The patch could be changed to use zle_highlight only if its values
aren't the currently-well-known defaults. This way, if user will not
customize the codes that are being sent, he will choose to use
termcap, and be protected in the unknown-to-exists situation of
running Zsh on a terminal with custom 256 color codes (i.e. not
\e[38;5;N).

But when user will customize zle_highlight, then termcap will not be
used but the customization instead will be. User customizes --> he
want's thing to be used (of course, he's demand could be selective,
only for 256 colors or only for True Color, hehe).

> The
> sequence I used has decimal numbers separated by semi-colons but judging
> from https://iterm2.com/documentation-escape-codes.html there's a
> macOS terminal emulator that may want hex triplets. This is what I was
> referring to when saying I was unsure what form the zle_highlight fields
> should take. The current hard coded escape sequences work for everything
> I've tried.

The iTerm2 code is for changing the terminal's palette. With the
"untouched zle_highlight -> termcap" condition, this would be covered
anyway. If user will customize zle_highlight for e.g. tests, he will
be able to do <<TERMINAL==XYZ -> ZTST_unimplemented='terminal with
non-standard-codes'>> and simply don't bother about a specific
machine. And, in this situation, he actually may be interested to
still run the tests, even on such custom terminal, as the codes output
by Zsh will be standard anyway (and TERM will be xterm-256color
anyway).

> Oliver

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



Messages sorted by: Reverse Date, Date, Thread, Author