Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG?] If true-color is used, overlapping colors do not work
- X-seq: zsh-workers 43797
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG?] If true-color is used, overlapping colors do not work
- Date: Wed, 7 Nov 2018 15:40:17 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:from:date:message-id:subject:to :content-transfer-encoding; bh=vZ0sDZ0VPkQSzx8XDx+OKaamliEni8wKDNh9zGMl61s=; b=HTBiaZ2GtmmH6vgd7dDKMAXt9ATp1wCYzbcExbWFrJ31Jqgptg8qRkkG7lQ2OOerFI 0rWGMjAhui2C9NPWhuUkYjju5L6z8i/95encDsJN3oQW2Y+lqOoE5Wg/dvXeo4CS1tl/ /9OIIUVLVLGhJJwQtsc0S6Qh9WBlchM/SFYk4lCXY6DKXQn1RTs67y2mBiY3QkSdzFzw LnV8/3LB9suJA7NeIkrEFq1tF45PFLZhywXqfTq4t/ozTulGcH9QjaVa4hGj/LT1nq94 JVQyk34eZWzx/j2bjhMEG841udZXN9WeUT/8kZAuoCGymBV0S9fLP6q1Ra+PVdVDGRJN lshA==
- 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>
A simpler way to observe this:
% zsh -fi
% rh_widget() { BUFFER="true"; region_highlight+=( "0 4 fg=#00cc00" ); rh2; };
rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
zle -N rh_widget
bindkey "\C-a" rh_widget
% <press ctrl-a>
On Wed, 7 Nov 2018 at 14:19, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello
> The last test from the attached ztst reveals this. Before-last test overlapping colors with standard fg=green/fg=red symbols. Result is a word "true" with "r" in red the rest in green. You can see the colors by doing cat /tmp/output.
>
> With true color, I get:
> --- /tmp/zsh.ztst.77121/ztst.out 2018-11-07 14:11:51.000000000 +0100
> +++ /tmp/zsh.ztst.77121/ztst.tout 2018-11-07 14:11:51.000000000 +0100
> @@ -2,5 +2,5 @@
> rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
> zle -N rh_widget
> bindkey "\C-a" rh_widget
> -0m32mt31mr39m32mue39m
> +0mt38;2;204;0;0mr39mue
>
> The minus-line is not yet updated, inherited from basic 8-colors case (which is working and overlapped colors can be observed in the minus-line). But look at the plus-line. It doesn't emit any color for "t", only true-color red for "r", and then nothing for "ue".
>
> With zsh/nearcolor loaded (test code pasted at the end of this email), colors are correctly overlapped:
>
> --- /tmp/zsh.ztst.76836/ztst.out 2018-11-07 14:09:32.000000000 +0100
> +++ /tmp/zsh.ztst.76836/ztst.tout 2018-11-07 14:09:32.000000000 +0100
> @@ -3,5 +3,5 @@
> rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
> zle -N rh_widget
> bindkey "\C-a" rh_widget
> -0m32mt31mr39m32mue39m
> +0m38;5;40mt38;5;160mr39m38;5;40mue39m
>
> cat /tmp/output confirms this.
>
> zsh/nearcolor test case:
>
> zpty_start
> zpty_input 'zmodload zsh/nearcolor'
> zpty_input 'rh_widget() { BUFFER="true"; region_highlight+=( "0 4 fg=#00cc00" ); rh2; }'
> zpty_input 'rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }' # `r' in red; the above line would be too long
> zpty_input 'zle -N rh_widget'
> zpty_input 'bindkey "\C-a" rh_widget'
> zpty_input $'\C-a'
> zpty_line 5 # 3 lines echoed back + 3 empty lines (zpty bug)
> zpty_line 1 p
> zpty_stop
> 0:overlapping region_highlight with true-color
> >zmodload zsh/nearcolor
> >rh_widget() { BUFFER="true"; region_highlight+=( "0 4 fg=#00cc00" ); rh2; }
> >rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
> >zle -N rh_widget
> >bindkey "\C-a" rh_widget
> >0m32mt31mr39m32mue39m
> >exit
>
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org
--
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