From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 0d30c407 for ; Fri, 7 Dec 2018 20:27:25 +0000 (UTC) Received: (qmail 7970 invoked by alias); 7 Dec 2018 20:27:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43870 Received: (qmail 5251 invoked by uid 1010); 7 Dec 2018 20:27:11 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.210.49):SA:0(-2.0/5.0):. Processed in 2.115035 secs); 07 Dec 2018 20:27:11 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=im7tBnq5viGLc5L/7QjT4aqn77Mq1r97lqm8CiKbOBg=; b=DzDtoFrexrQg0YaG/dID/HMKoOvdwEJczMXSMN6F8ZqryZHOC3LrfPQpQq46b+CUsQ aBw4XosmcpoiITAyR7Psytr+xtVSSC+cHdf3CqonbXgtHcUfqhU8CLYwdubVlhQpkfAR b4Qo1I5tQ+84XSHUohB9xWNWkVxKSDpJHo0Ju06G7VJZELW/Yc5dQM1BP5a1JtXo3dO+ JO38Pzz7eVM6615QO8KBHOPBnhqpvxDZ2l5pu5EDEXRXv95nETNYtcSKIKAxO+hgaMNj sazWNZJisMalSDJFt2xnw/H5QN5Mp+1AbZwXfFh+QSbcQ6P5bQI/3cCSdIoQ1QpeRLXD kfnA== X-Gm-Message-State: AA+aEWYqKLoTPasq2lXGxfPM+DxnwjmJ/WeLs+qEbf7NFE15R8NjMEg1 idGOo/xVjmgDLEVzZtQRh2+LnZ+f2EFh2GIvqXI= X-Google-Smtp-Source: AFSGD/VnUQ4aZpFb0qNTXppq92mOrmfFsn5SlZmVXzX4wUPBzhmmTitj5U9RW1H/IEFFc6BEast7jRUVgf+b5eQNDqE= X-Received: by 2002:a9d:3bc7:: with SMTP id k65mr2504725otc.11.1544214426586; Fri, 07 Dec 2018 12:27:06 -0800 (PST) MIME-Version: 1.0 References: <2362-1541646201.813952@nGIL.zWP_.YhaK> <20626-1541726901.821000@xGvJ.shtD.SkCN> <31159-1543080743.164776@h8df.-SiL.hblq> In-Reply-To: From: Sebastian Gniazdowski Date: Fri, 7 Dec 2018 21:26:54 +0100 Message-ID: Subject: =?UTF-8?Q?Re=3A_=5BBUG=5D_General_256_colors_bug_=E2=80=93_zle=5Fhighlight_=2F?= =?UTF-8?Q?_fg=5Fstart=5Fcode=2C_etc=2E_is_not_respected_=28was=3A_highlight_test_c?= =?UTF-8?Q?ases=29?= To: Oliver Kiddle Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Fri, 7 Dec 2018 at 02:55, Sebastian Gniazdowski 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