Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] General 256 colors bug – zle_highlight / fg_start_code, etc. is not respected (was: highlight test cases)
- X-seq: zsh-workers 43870
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: [BUG] General 256 colors bug – zle_highlight / fg_start_code, etc. is not respected (was: highlight test cases)
- Date: Fri, 7 Dec 2018 21:26:54 +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=im7tBnq5viGLc5L/7QjT4aqn77Mq1r97lqm8CiKbOBg=; b=jXKQ7j9dg0er/wvghP9XtHg6FyupiDRceGvCtXgblQ3n3vlUT07ZxWXFiTM3TraILR zVmvQ9cEN141GgEulPxEaf813UwekWTstJbJ384a47ck3K97gE+26wwktqYdPizwasm9 K3iO4neQmbVHWr8uLoM0h0gg0OZfyn4vjAN2r9czI6Lpj9zbC7hQ+XYDQslVNtPgnWOl Zj18CXdIjyRFxsQTurXzgLrWaHfPo3m1eqfH05F1Q/O3uPWZO05h/wO55dBytpC7NAYN rsU+G1CMtmaYNyNp5q9sp9Pa/iL7ElFdL2D/svNCS8O6cV172tkuW6dCm9PWyQNIEPZa 1m6w==
- In-reply-to: <CAKc7PVBR2sVxPfA731V-HD0S2Qe6H5=dQpVc+-yhUM-yS6m2hQ@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: <CAKc7PVDgEtfLAibbxRr36=UgPoPk8grvsH5G2+AOipr_vmt-cQ@mail.gmail.com> <2362-1541646201.813952@nGIL.zWP_.YhaK> <CAKc7PVAPxxtSaV5qMWzaueW+9_ZHXrHYX2032cHYYDq3Gh399w@mail.gmail.com> <20626-1541726901.821000@xGvJ.shtD.SkCN> <CAKc7PVBpL_HwKUHLD5mQCLmWszfnrbJ2ARyrkzVKsi6yStWeNA@mail.gmail.com> <31159-1543080743.164776@h8df.-SiL.hblq> <CAKc7PVDF1=izGKVqGUB++bpvse4fzg+xJ93K-0_ayzYW2cVZXQ@mail.gmail.com> <CAKc7PVBR2sVxPfA731V-HD0S2Qe6H5=dQpVc+-yhUM-yS6m2hQ@mail.gmail.com>
On Fri, 7 Dec 2018 at 02:55, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
> So again no CDE|3...|, but raw ^[38;5;196m. So this is a general Zsh
> bug, not near-color bug, as zsh/near-color module isn't loaded in this
> test, it's only the 256 code "fg=196" that is being used.
Following Daniel's request of a minimal test case that makes the
problem visible:
widget() { zle_highlight=( fg_start_code:"CDE|3" fg_end_code:"|"
bg_start_code:"BCDE|4" bg_end_code:"|" ); BUFFER="true word2 word3";
region_highlight=( "0 4 fg=196" ); }
zle -N widget
bindkey '^T' widget
And after pasting and accepting in zsh -f, press Ctrl-T. You will see
red word "true" followed by "CDE|39|" and the other words, i.e.
% trueCDE|39| word2 word3
(the true is in red, but cannot visualize this in email). So:
zsh_highlight was ignored for 256 color code, only code ^[[39m has
been processed by zle_highlight, while the fg=196 code was output
unprocessed, i.e. as ^[[38;5;196m.
Could the problem be fixed, .. ASAP? It collides with my work of
providing X04 tests and is a blocker for making a new Zsh
release. I think Oliver touched the responsible code lately, as for
true-color (not 256 color, with or withoutzsh/nearcolor), the
zle_highlight processing works, i.e. I'm getting, e.g.:
0m27m24mCDE|38;2;0;204;0|tCDE|38;2;204;0;0|rCDE|39|CDE|38;2;0;204;0|ueCDE|39|
in an X04 test case. So all 24-bit escape codes are nicely covered
with CDE| etc. things from zle_highlight. So maybe it seems that the
"get text representation from already processed entries in
region_highlight" that Olivier did is used also here.
So basically 256-color doesn't obey zle_highlight, while first 8/16
colors and TrueColor are obeying it.
--
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