From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
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: Sun, 9 Dec 2018 19:45:05 +0000 [thread overview]
Message-ID: <20181209194505.zsuylzojjv3rebpl@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAKc7PVBUFSujsBRHi_wbC2zZZp18QdW=1MnrgRzGC+S7T1xEgw@mail.gmail.com>
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?
> BTW. I've made X04 zle tests more rock-solid, because the debug prints
> I added to track the 256-color/zle_highlight issue were slowing down
> Zle, and a rare phenomenon (not occurred from the time I've simplified
> Zle, disabled the echoing of input text) became very often: Ctrl-D was
> appearing too quickly after Ctrl-A. A sleep of 333 ms made the problem
> go away, and I think the issue is solved, and Zle tests are quite rock
> solid now.
That's great.
> 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.
Cheers,
Daniel
next prev parent reply other threads:[~2018-12-09 19:45 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 [this message]
2018-12-11 0:01 ` Sebastian Gniazdowski
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=20181209194505.zsuylzojjv3rebpl@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=sgniazdowski@gmail.com \
--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).