zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] Support true colours via termcap interface
Date: Mon, 4 Feb 2019 09:11:04 +0100	[thread overview]
Message-ID: <CAKc7PVBQt3YJg5ED-R6UsDkmOchSGQXBMpfH_HBNSoxMXhh7Gw@mail.gmail.com> (raw)
In-Reply-To: <20190204061946.dmygdd7n5c2zoi7d@Daniels-MacBook-Air.local>

On Mon, 4 Feb 2019 at 07:20, Daniel Tameling <tamelingdaniel@gmail.com> wrote:
> > I.e. remove  or in other way lessen the use_truecolor condition.
> > Without this the true color output will be bypassing termcap.
>
> That is not necessary. use_truecolor is false and use_termcap is true,
> because TXT_ATTR_FG_24BIT isn't returned by match_colour but
> TXT_ATTR_FG_TERMCAP.
>
> Btw. I did that deliberately. I didn't want to make the if even more
> complicated and I wanted to use the same code path as for the
> %F{16763955} syntax. Making a small change to match_colour felt nicer
> than to hack around in set_colour_attribute.

Ahso,,ok, but I don't see the *_TERMCAP code being returned here,
could you explain?

> > -               return on | (is_fg ? TXT_ATTR_FG_24BIT : TXT_ATTR_BG_24BIT) |
> > -                       (zattr)colour << shft;
> > +                if (tccolours != 0x1000000 || colour < 8) {
> > +                        return on | (is_fg ? TXT_ATTR_FG_24BIT :
> > +                                     TXT_ATTR_BG_24BIT) | (zattr)colour << shft;
> > +                }

> >
> > Currently, the code  `print -P %F{16763955} ' DOESN'T work, so your
> > change does something that makes it working
>
> It doesn't work because match_colour currently returns TXT_ERROR for
> this sort of syntax if colour >= 256.

Ahso, ok.

> > , however the first code
> > example:
> >
> > print -P %F{'#ffcc33'} test
> >
> > Works with current code (ie. without the patch).
>
> Well, it works differently:
>
> Before the patch, the hardcoded escape sequence is used:
> $ TERM=xterm-direct print -P %F{'#ffcc00'} | cat -v
> ^[[38;2;255;204;0m
>
> Afterwards the terminfo entry is used:
> $ TERM=xterm-direct print -P %F{'#ffcc33'} | cat -v
> ^[[38:2::255:204:51m
>
> The former works because xterm understands both escape sequences, but

Ahso, OK. Let me just point the difference: the second code has two
clons after "38:2".

BTW., I recomend the following lecture (created by an iTerm hacker) to
know more about the termcap-codes deviations:

https://terminalguide.netlify.com/attr/fgcol256/
https://terminalguide.netlify.com/attr/fgdirectcolor/


That said: does the new X04 test pass with your patch?

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

  reply	other threads:[~2019-02-04  8:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-03 21:57 Daniel Tameling
2019-02-04  2:15 ` Sebastian Gniazdowski
2019-02-04  6:19   ` Daniel Tameling
2019-02-04  8:11     ` Sebastian Gniazdowski [this message]
2019-02-04 21:21       ` Daniel Tameling
2019-02-07  7:36         ` Sebastian Gniazdowski
2019-02-07 20:32           ` Daniel Tameling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKc7PVBQt3YJg5ED-R6UsDkmOchSGQXBMpfH_HBNSoxMXhh7Gw@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).