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
- X-seq: zsh-workers 43890
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- 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
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hWuajq1UF6zpT8vLaaw9I/Q9w3G20vfftyqPAKci42I=; b=NSanT83zTkbC+3DMOdGTvTXR63qYiDa87EHl90ZDXggu4j5DgyoSKhMFZUQ+uH9gt5 0o60gq5yctxJMC1yjcH7eqcH4kbucqLnIFky8wqfByVZJWtBfWn3hemyzAT+TNLN9Z1M hqGkTWzOa09+7+nT5JRCvAP3G8eEmDBvUcZl3nJgjTgbbj9WUs/mb3J56PvZ8YQA1LVM eWUhh5EKGWQtnHsISwYBkRota4BCtXm7FXpSbM1yf7SY0NfT7zGSxqXK0bp/20EVR0FW 5FyB999MLAhklGqaKe2kGr8tpCDXzlZquvla9sal4ggT0jg14uwbsSKgwKTEOGKgpLxr TjaQ==
- In-reply-to: <20181209194505.zsuylzojjv3rebpl@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBUFSujsBRHi_wbC2zZZp18QdW=1MnrgRzGC+S7T1xEgw@mail.gmail.com> <20181209194505.zsuylzojjv3rebpl@tarpaulin.shahaf.local2>
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