zsh-users
 help / color / mirror / code / Atom feed
From: Thayne <astrothayne@gmail.com>
To: zsh-users@zsh.org
Subject: Using 8bit colors in prompt expansion on a terminal with 24bit color support
Date: Mon, 6 Apr 2020 17:52:38 -0600	[thread overview]
Message-ID: <CALbpH+iPSD-Pn81vHzaMv=kDciCv95nxxH9JCzYHk3XWJjTSxg@mail.gmail.com> (raw)

I recently tried out powerlevel10k, but ran into something weird. The
classic theme had blue backgrounds, where it was supposed to have gray
backgrounds. After some investigation I discovered it was because the
`%K` expansion just passes the value through to the setab terminfo
format, which in the case of "direct" terminfo entries
(alacritty-direct in my case, but I think it would be the same with
xterm-direct) assumes it is an RGB value if it is greater than 8.
Apparently this is intentional behaviour
(https://lists.gnu.org/archive/html/bug-ncurses/2019-03/msg00009.html)
for terminfo.

Is it expected that zsh's prompt expansion for colors behaves this
way?If so, maybe the documentation on it should be more clear that it
is the users responsibility to make sure that you use 24bit colors
(with hex) rather than 8bit colors if the terminal expects it (by
checking for the RGB property in terminfo). Or should zsh map the 8bit
color to the corresponding 24bit color?

             reply	other threads:[~2020-04-06 23:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 23:52 Thayne [this message]
2020-04-07  6:11 ` Roman Perepelitsa
2020-04-07 10:57 ` Oliver Kiddle

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='CALbpH+iPSD-Pn81vHzaMv=kDciCv95nxxH9JCzYHk3XWJjTSxg@mail.gmail.com' \
    --to=astrothayne@gmail.com \
    --cc=zsh-users@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).