Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: region_highlight converts `fg=default` to `none`, which is not the same
- X-seq: zsh-workers 47485
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- Subject: Re: region_highlight converts `fg=default` to `none`, which is not the same
- Date: Fri, 23 Oct 2020 13:38:11 +0200
- Archived-at: <https://zsh.org/workers/47485>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-10/CAN%3D4vMoUZExCRW4u%3D%2BD_LPgQBf4HoLFmDiwTaUepbHdJN3qQKw%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-io1-f67.google.com) smtp.remote-ip=209.85.166.67; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, 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=eilnnKMPbScb1r2KX8Z7HBQ90iz6gReDJrttVtYJJo4=; b=K0EwqDDq0cTF4Y0QH+CAuoSgLU9vWrf/cVD17SjRjZul9wVTXoCqxdYqxWssTg1VCA Bwgkltnm4H+Kw7jQDkLzEkMbKlQYn4sOExObb0Hh17D/ypbkc3WMQKSOb2EcuFj1O5ou 3BgSU7D8BrNAOkSsxK1RMTtx0fZsdGpRiJOGh//LWjQbe6pll7EvTwB58N2yBfyecKNZ ZLmoKutTL3lvdBfpIxPjlAWu54woF0LS0eqZpKzfyBP8zH9bHMMY6+wEFivA3GfhdEDr rctS8TNhQ6ic8eWFHtwlEfJZp9w99bJJvpemty4SBn+z4fs0VIs6uUmAIu0+PfzLaUYh 4IQg==
- In-reply-to: <CAHLkEDs_jT3A8833MkO6r6rOB=3Rshi-hqDcshXSY8EBs6sy-Q@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAHLkEDv9ch+nhtpYF3So+029J6GMv5iU-8=RzHRHLa7OYzc3kg@mail.gmail.com> <CAN=4vMq1CjLKiwM0_HWfQf5=xLTGQ7z9mVs=QEsCp05suLK-fA@mail.gmail.com> <20201014204621.4cf5b2b0@tarpaulin.shahaf.local2> <CAN=4vMqencidrpknTheyjAYQRT9BHN8ZLXRFk2Z38Gfwx9mxyQ@mail.gmail.com> <cd3c7101-2735-4e4e-a40f-76d0850f471d@www.fastmail.com> <CAH+w=7aHWUQSFCJ3NQDVDBg=X8J1WD+YbNMQ21=c4xXs=LPBqg@mail.gmail.com> <CAHLkEDvThAYDbqvVt9u8tRDxSnXjXo=hCierGQODA4KZPcQzxw@mail.gmail.com> <CAN=4vMr+dXkY3LsfRoJO06dHV=Y8MB3S1RFwqZ1m6YGJhLK3dQ@mail.gmail.com> <CAHLkEDuhnFzF5Xad7t66DGrwY=Ri9-7VN_P-yOUr03GGTUiKSA@mail.gmail.com> <CAN=4vMrJ4_kLMmLdJn7VtTNu7g-=uj-wdZJeq9w36Nq5_p0UyQ@mail.gmail.com> <CAHLkEDs_jT3A8833MkO6r6rOB=3Rshi-hqDcshXSY8EBs6sy-Q@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Fri, Oct 23, 2020 at 12:40 PM Marlon Richert
<marlon.richert@xxxxxxxxx> wrote:
>
> On Fri, 23 Oct 2020 at 12:35, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
>>
>> The only way to know whether the terminal supports some capability
>> (e.g., moving the cursor to the specified location on the screen, or
>> highlighting text with 256 colors) and to use the said capability is
>> through terminfo. There is no way around it.
>
> Sure, but that is not necessary for this particular problem.
Which problem? As I mentioned, it's definitely possible to add support
for italicized text to zsh and to make it consistent with the existing
highlighting API.
The fact that region_highlight and zle_highlight support "standout" is
not a problem but a feature. Standout is a part of the curses standard
and zsh interprets it within region_highlight and zle_highlight in a
manner consistent with the standard. ("standout" within "colors" is a
different matter. That one is incorrect in my opinion.)
> If the user wants to pass something to their own terminal, then
> just let them. Zsh already lets the user pass in ECMA-48 SGR
> parameter values directly in [...] prompt expansions.
Do you mean %{...%}? It's indeed useful and allows the user to insert
any byte sequence into their prompt. I don't think there is anything
specific to ECMA-48 SGR in prompt expansions, or am I missing it?
region_highlight doesn't need the equivalent of %{...%} because it's
implied. So something like this could work:
region_highlight=($'1 2 raw=\e[4m')
The value of `raw=` spans until the end of the string, so if you want
to combine it with `fg=42`, you'll need to use `fg=42,raw=\e[4m`
rather than `raw=\e[4m,fg=42`. That's one way to do it -- I'm not
particularly attached to it, just thinking out loud.
One tricky part about this is that it doesn't allow you to specify the
sequence that undoes the effect of `raw` but this is probably OK
because zle inserts SGR0 before every that may have different
highlighting. There is something in the code that suggests this isn't
always the case but I don't know where this code actually triggers.
From the implementation's point of view this will require quite a bit
of work because this doesn't fit the existing framework around zattr.
Roman.
- References:
- region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
- Re: region_highlight converts `fg=default` to `none`, which is not the same
Messages sorted by:
Reverse Date,
Date,
Thread,
Author