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 43880
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- 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
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=fm2; bh=P1Y mMH0puzhEaAarUYlMU9fLOe+j6HdrDUIPgCYlBUc=; b=lvzChI2tFBd97fwu57/ iTM2LO6g3l3uGkOlG+V9dhnVHoetBKWY7Ci3TljJWruMx0yYANIMwFRJC52M0oSg GDGPj0T3qxKtKYpZWP8PVfQfJtwiy+ENHONEMgcb/u9ZVaXwAILfQKF3eYnL6mK9 CxLkQdmQp3LSkmnupa6bxSGoSbrr+7MKo2/HvOVqHp3AY8FE67ryIqBXBPDPCZVU nC7EbODvzK5fE9HvpabivaW08WdUIdgFbtb2ajuUDDQAV+5pqxvq20BPdzr4NlAJ uqbz7QuYs03RUcpUubR5vguZLoHunFYXvCfDZzbXPLz0MqRrIk3LFbtJg7BzPlCF kRQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=P1YmMH 0puzhEaAarUYlMU9fLOe+j6HdrDUIPgCYlBUc=; b=k0MFeJzUQoYehZiD2FcCI6 C74QxNdXfqmVlOSjwyz2CySYzh7ptZAUxy3EqVCKxbNpeEh+HQpfUflVBf57reHN AUBy9gpJIUEdmlc2Jp7Mu5O9pY7PqGpIk+pY1Ax4Ul/TU+UclEI6CiS51+cCqeg3 sGaeX2dMpehdjoaFHVNAQPDZ/tg34lXdAw2HMklikwoTiN+8cBdrA7wcVHyFcU5s 8CLnBaY04qspvpvgWfY9jy9L+U3slJCFgh30PCENhjSn/V292NseJfrASzx7bnrW X3PsH524xpxnwKcDWLUFA1eU3/VBEKPCNaixJxJtoRIp0rq3B7/UeCN7PKkQVmKA ==
- In-reply-to: <CAKc7PVBUFSujsBRHi_wbC2zZZp18QdW=1MnrgRzGC+S7T1xEgw@mail.gmail.com>
- 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>
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@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.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author