From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7857 invoked from network); 23 Oct 2020 09:25:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Oct 2020 09:25:27 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1603445127; b=Q4wB+MOVobgVNWWF+ER9CQG6PdN8haYjhd7soJ1O8Mx+iiHmUc4QikzW8l9vhRj5vyYeK4ze7j mjQ/Uvh+qcGocnNI6MdA7JBd0Eb3YmuoBObKzEh7WLVzK50HC8+JGBb1JyA2+MS6Nw9xOyodtX Q5/A8UTYC+IL1c4ib0R3RmxRNvpjuU/6yTRrD6OBKtuiFYZvJbJqZiTb50Lh1FGm+55AHdwMGd PoFWTHdYdlrKieocRSKaFrTbaaX0luhoYvn0mq4Y4YDeA+HhzqOe3V0XyQuan7hlUoAbu4xm7u qU6fAezRMCiM+LqICk+gx6Ws73tTgRt9qcuPHAse2Dik8Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f173.google.com) smtp.remote-ip=209.85.208.173; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1603445127; bh=rJeQpNlcWVbYBmsGTIDoLhCzpwBhnp8obs5haDIAOh0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=zfrasJyA1qhjmVSTaoNlzzhbiOA1BCnzWlDOH+dt/Clt5by/qYIpPeFeLJktj8NYzA4Xj8AaQ0 3Vuty6yrixQivPxHo/5wtxanrJYycYTr1U9FWv03Vy0J21ZQU6FqSA3W/qKRPPwbf9PC9H1JAk jc9TzpjCmy81YrPu8chtBWkHIK1nxEtaRjKMgK6eFC1O1MPkW0HGrpryOqNiTZ+k7eaagFbLyW ElVTqcsEc+76Z13JUsdvwL2VYYN6nCxdKTfVF5IM6Ovn7/pq59K6txQLS/qnC2IDP1NfptHWk0 vJQ3nYEWKKPrP7C1KXoIsdLaaMP2OG7RX+sCVmHew0QxSA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=mcvRbKYgyBZK3zETmnwsEX1S9G74c5nWYBbN0/p0NrY=; b=T16Q43Xfk76+yRakfxM+41u4tS Zl8dZGutCn/dAC/f0KuSzGKQf/neq3aCr8nolUH+B2LaWXXFS2PXWCIfCbVWSj5VyEAwUBpH5suIg EhQCKIRMT+fSRzukirE3O/HVcMjsm/1/3GKkt4OBF44JF2nQirqhcZpZN9tqM5CbryckTTsV9iuOr cRbfnbAmge3dZ3ZZlHIAeNkqpvB+iNymh99rjN3UdnVZC2e4c5WQCPj10K1vdLbZAQkLm8oiWBeNF 99TZadDUpZa4vgwH7R2kUr/rW6qoyEa4Jt8LQLo847Fx74wKcLmBaCS8OOYqzE6Q7S3hsmJePh1fj Z2ELnkhw==; Received: from authenticated user by zero.zsh.org with local id 1kVtKA-000Mb5-Tp; Fri, 23 Oct 2020 09:25:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f173.google.com) smtp.remote-ip=209.85.208.173; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f173.google.com ([209.85.208.173]:45211) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kVtJu-000MRq-42; Fri, 23 Oct 2020 09:25:10 +0000 Received: by mail-lj1-f173.google.com with SMTP id a4so806473lji.12 for ; Fri, 23 Oct 2020 02:25:10 -0700 (PDT) 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=mcvRbKYgyBZK3zETmnwsEX1S9G74c5nWYBbN0/p0NrY=; b=KAzZpdp5NxZsLR3+F+v4DJDzlW1E+b4aU9zoyN20rNrAMSXY67ccVMNPo/EASug4WU CfyIPiMEk0/TcAJA5YG60xvyXWoHrroJygTOxHjsb8snevtAn9KbrTkqD2/CXNW9ZmUE 0e1eQmcJmiE9zn8OvZl/aq7jwGJHm8B0i/YO34rKo84bOzBhYbOkPii5LjHtqB5uhAmw cHeHRHhu+WTdM4NkVIPXnV5pLLf56ZfzJjMvXaVTEJJdWcYmFRITEf++noNT38iYI8a4 YuDrFz1icC23Lm1+1iqiiBIxboK4C/sXc/+fc8Vqo5A6cIu5W3WtkdOKnKIivQCpDKLL Zwzg== 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=mcvRbKYgyBZK3zETmnwsEX1S9G74c5nWYBbN0/p0NrY=; b=debo7+Rl0Q/8AoA2vENeRqg3rGNMfuE8rSn/OBmg9Q1M8ihWOP9PF8O/gt4F0vKLbq 9KCUg+CXud1Up7vVMTi/ovqcGeqj8cq15+vLVS/rKbZ/g9myjokGoS887kGKt/ESiZH9 SGDDFTg5s+DSUUYNbuqNJVAUXjDGPD8suuF4ZX6v1okmYE3fahyDgviLPwDz0A7MU577 TELPkb2xiKntJJJZd/2w0rcwui1CSgWn9Vnmm4XGfeoigLenA4MV1MBPggI+W1x73ZS+ snjWsCbr5Im+xbwZQg0LtZBT4I/Gbc4q5QEJD9vaAF3v9MjOrdYOFUT+VJOVHLecHVmX ahng== X-Gm-Message-State: AOAM532XPefWteVDswsc1G9uZomKn+kGW5pJK4LS52VaWp5mLseHA5eW FAXFxXvQpJ/hA6dv25OGQloEEvi4TOsq3LvEV98= X-Google-Smtp-Source: ABdhPJzA9fYFuRbILwDKvm4jbDvatCg1pNWPJGKAQZ6MUfOP04MdgR7sCMWXq7dsNMTjHNISUQ06HMCCQ9045nlqYi4= X-Received: by 2002:a2e:9942:: with SMTP id r2mr468135ljj.409.1603445109166; Fri, 23 Oct 2020 02:25:09 -0700 (PDT) MIME-Version: 1.0 References: <20201014204621.4cf5b2b0@tarpaulin.shahaf.local2> In-Reply-To: From: Marlon Richert Date: Fri, 23 Oct 2020 12:24:57 +0300 Message-ID: Subject: Re: region_highlight converts `fg=default` to `none`, which is not the same To: Roman Perepelitsa Cc: Bart Schaefer , Daniel Shahaf , Zsh hackers list Content-Type: multipart/alternative; boundary="00000000000026146f05b253280e" X-Seq: 47482 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --00000000000026146f05b253280e Content-Type: text/plain; charset="UTF-8" On Fri, 23 Oct 2020 at 02:28, Daniel Shahaf wrote: > You haven't explained why you think it's zle that does the conversion. > For starters, what's the output of `tput smso | xxd` and `tput rev | > xxd`? Here they print the same value, even though \e[3m; does > italicize. (Plain xterm on Debian.) > Ah, my bad. I assumed `region_highlight` handled visual formatting similarly to how `complist` and prompt expansion handle them, and assumed that the exact same names used in the `colors` function meant the same thing. I'm sure many other Zsh end users will assume the same. It would be great if all four of those could be made consistent with each other. On Fri, 23 Oct 2020 at 11:08, Roman Perepelitsa wrote: > Previous discussion about standout, italized and negative image: > https://www.zsh.org/mla/workers/2019/msg01189.html. Thanks for the link. Did that discussion ever result in a patch? It looks like you never got an answer to [your question]( https://www.zsh.org/mla/workers/2019/msg01191.html): > Shall I send a patch? I'd love to have this feature. I'd love to have `region_highlight` just accept and pass through unmodified all ECMA-48 SGR parameter values. (See http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf, page 61.) It is a standard, after all. I feel like routing this through `ncurses` is not only unnecessary (since we have a standard for this); it's also problematic. For many terminals, there is a significant lag between their last release and the last time their `terminfo` entry in `ncurses` got updated. (The entry for macOS's Terminal.app, for example, is already 3 years old and you get better results from `ncurses` by letting Terminal.app declare itself as being `xterm-256color`, rather than relying on the `nsterm` entry.) Rather than using `ncurses` for this, I'd rather see the principle of ["graceful degradation"](https://en.wikipedia.org/wiki/Fault_tolerance) be applied here and let the terminal itself handle (that is, ignore) those SGR parameter values that it does not support. --00000000000026146f05b253280e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On = Fri, 23 Oct 2020 at 02:28, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
You haven't explained why you think i= t's zle that does the conversion.
For starters, what's the output of `tput smso | xxd` and `tput rev | xxd`?=C2=A0 Here they print the same value, even though \e[3m; does
italicize.=C2=A0 (Plain xterm on Debian.)

Ah, my bad. I assumed `region_highlight` handled visual formatting simil= arly to how `complist` and prompt expansion handle them, and assumed that t= he exact same names used in the `colors` function meant=C2=A0the same thing= . I'm sure many other Zsh end users will assume the same. It would be g= reat if all four of those could be made consistent with each other.

On Fri, 23 Oct 2020 at 11:0= 8, Roman Perepelitsa <rom= an.perepelitsa@gmail.com> wrote:
Previous discussion abou= t standout, italized and negative image:
https://www.zsh.org/mla/workers/2019/msg01189.html= .

Thanks for the link. Did that discuss= ion ever result in a patch? It looks like you never got an answer to [your = question](ht= tps://www.zsh.org/mla/workers/2019/msg01191.html):

=
>=C2=A0Shall I send a patch? I'= ;d love to have this feature.

I'd love to have `re= gion_highlight` just accept and pass through unmodified all ECMA-48 SGR par= ameter values. (See=C2=A0http://www.ecma-international.or= g/publications/files/ECMA-ST/Ecma-048.pdf, page 61.) It is a standard, = after all.

I feel like routing this through `ncurs= es` is not only unnecessary (since we have a standard for this); it's a= lso problematic. For many terminals, there is a significant lag between the= ir last release and the last time their `terminfo` entry in `ncurses` got u= pdated. (The entry for macOS's Terminal.app, for example, is already 3 = years old and you get better results from `ncurses` by letting Terminal.app= declare itself as being `xterm-256color`, rather than relying on the `nste= rm` entry.) Rather than using `ncurses` for this, I'd rather see the pr= inciple of ["graceful degradation"](https://en.wikipedia.org/wiki/Fault_tolerance<= /a>) be applied here and let the terminal itself handle (that is, ignore) t= hose SGR parameter values that it does not support.

--00000000000026146f05b253280e--