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

Re: [PATCH] Make 256 color codes be based on zle_highlight array, not on termcap



On Sun, 9 Dec 2018 at 20:45, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Sebastian Gniazdowski wrote on Sat, Dec 08, 2018 at 23:04:33 +0100:
> > Is the patch acceptable? I imagine someone might suspect there exists
> > a terminal that uses escape codes for first 8 colors, but some other
> > kind of codes, collected in termcap, for remaining 248 colors. Can
> > this be considered impossible to accept the patch?
>
> Might someone out there have a terminal whereunder the sequence ESC 8 ; 5 ; <number>
> doesn't change the foreground color, but does something else?

I've addressed such possibility in 43888 (i.e. in thread: "highlight
test cases (was Re: [BUG?] If true-color..."). In the proposal,
termcap would be used only when zle_highlight is not customized. This
way one will be able to made an actual use of zle_highlight, write
tests, do debugging, etc. and user will be still covered in case of
uncommon-terminal.

> > commit 5dda212b3be3f1f12ad31e3d6543d367f987ee55
> > Author: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
> > Date:   Sat Dec 8 22:42:49 2018 +0100
> >
> >     Instead of using termcap, 256-colours are based on zle_highlight entries
> >
> >     Following code snippet performs the conversion of colour number to the
> >     code to be emitted to terminal (the example shows foreground color
> >     handling):
> >         ...
> >         strcpy(colseq_buf, fg_bg_sequences[fg_bg].start);
> >         ...
> >         } else if (colour > 7 && colour <= 255) {
> >             ptr += sprintf(ptr, "8;5;%d", colour);
> >         ...
>
> For future reference, it's better to post `git format-patch` output
> than `git show` output because the former can be applied easily (with
> git-am(1)) but the latter can't.

Thanks!
-- 
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