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 c608e4a3 for ; Tue, 11 Dec 2018 00:02:00 +0000 (UTC) Received: (qmail 23629 invoked by alias); 11 Dec 2018 00:01:49 -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: 43890 Received: (qmail 7038 invoked by uid 1010); 11 Dec 2018 00:01:49 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi1-f196.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.167.196):SA:0(-2.0/5.0):. Processed in 1.688725 secs); 11 Dec 2018 00:01:49 -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=hWuajq1UF6zpT8vLaaw9I/Q9w3G20vfftyqPAKci42I=; b=NSanT83zTkbC+3DMOdGTvTXR63qYiDa87EHl90ZDXggu4j5DgyoSKhMFZUQ+uH9gt5 0o60gq5yctxJMC1yjcH7eqcH4kbucqLnIFky8wqfByVZJWtBfWn3hemyzAT+TNLN9Z1M hqGkTWzOa09+7+nT5JRCvAP3G8eEmDBvUcZl3nJgjTgbbj9WUs/mb3J56PvZ8YQA1LVM eWUhh5EKGWQtnHsISwYBkRota4BCtXm7FXpSbM1yf7SY0NfT7zGSxqXK0bp/20EVR0FW 5FyB999MLAhklGqaKe2kGr8tpCDXzlZquvla9sal4ggT0jg14uwbsSKgwKTEOGKgpLxr TjaQ== 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=hWuajq1UF6zpT8vLaaw9I/Q9w3G20vfftyqPAKci42I=; b=t02/flknFPn2HAYibvSOwU0fOnRBBfpIQDerWxBeWqRo7ekiEhSiYisA/13Dp5mBts enePTrkyb1bFBhazA2WJS18QBbNxyxbY7070G7olMGujoKip7SxfpS4TXBTZOfDonsnv 418a2qDGiucBxKiIvzjEONszyn/YO+mCQGD1MZnLJjDwT8uP/zrXxLHPyZophvx0/Weu JHGqsL+QEgiUWRJjQbwe3xXrFjt/VnENrYSkB5hjfWvQFyT9GH1Uh5tlUJwI5UJuT5n9 gpaymhJfRRIE5Dy7t3mJzVCXFUZCl86/8GWWLjdx7F5nZk8Kt1DPNJ+9HuVVTX71mRqu g6Fg== X-Gm-Message-State: AA+aEWbH9Esai4UVTPKukb22v2UKT3ovctrXow86UCZEIGr5LwBqGxZS yYlJ3fSHD2esKD+u71BfUkRCgRPyCpDkHfiiMGgMUtR9 X-Google-Smtp-Source: AFSGD/WPMufxnC0dWI/g+tDaV8pROORMflDuvm76x9cEBM86gYOpJex+5+xjM6759pSr3b5zR3X6RdQiFLffF7xemdw= X-Received: by 2002:aca:cc0d:: with SMTP id c13mr91554oig.150.1544486505341; Mon, 10 Dec 2018 16:01:45 -0800 (PST) MIME-Version: 1.0 References: <20181209194505.zsuylzojjv3rebpl@tarpaulin.shahaf.local2> In-Reply-To: <20181209194505.zsuylzojjv3rebpl@tarpaulin.shahaf.local2> From: Sebastian Gniazdowski Date: Tue, 11 Dec 2018 01:01:33 +0100 Message-ID: Subject: Re: [PATCH] Make 256 color codes be based on zle_highlight array, not on termcap To: Daniel Shahaf Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Sun, 9 Dec 2018 at 20:45, Daniel Shahaf 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 ; > 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 > > 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