From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] Make 256 color codes be based on zle_highlight array, not on termcap
Date: Tue, 11 Dec 2018 01:01:33 +0100 [thread overview]
Message-ID: <CAKc7PVDpd9w0AV2ZdA+ixgpWR=6uEcRk1QWyhjET6sT3-xNV=A@mail.gmail.com> (raw)
In-Reply-To: <20181209194505.zsuylzojjv3rebpl@tarpaulin.shahaf.local2>
On Sun, 9 Dec 2018 at 20:45, Daniel Shahaf <d.s@daniel.shahaf.name> 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@gmail.com>
> > 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
prev parent reply other threads:[~2018-12-11 0:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-08 22:04 Sebastian Gniazdowski
2018-12-09 19:45 ` Daniel Shahaf
2018-12-11 0:01 ` Sebastian Gniazdowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKc7PVDpd9w0AV2ZdA+ixgpWR=6uEcRk1QWyhjET6sT3-xNV=A@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--cc=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).