zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: linuxtechguy@gmail.com
Cc: devs <zsh-workers@zsh.org>
Subject: Re: prompt colors bug? also possible feature add
Date: Tue, 19 Sep 2023 18:56:17 -0700	[thread overview]
Message-ID: <CAH+w=7Y0SLa72Sr-5iOU8p4euQrLtKxUkxyoSsGUpMkfMjADtA@mail.gmail.com> (raw)
In-Reply-To: <CA+rB6GKoxeFgvc7Deork3Ek2tFXz4Wg6SFKpvj2a35yhgY+fJQ@mail.gmail.com>

On Tue, Sep 19, 2023 at 6:15 PM Jim <linux.tech.guy@gmail.com> wrote:
>
> On Wed, Aug 23, 2023 at 10:45 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>>
>> On Wed, Aug 23, 2023 at 5:42 AM Jim <linux.tech.guy@gmail.com> wrote:
>> >
>> > The more I look into "functions/Prompts" and especially *fade and fire there is no
>> > change in color intensity or the use of "gray".
>>
>> prompt_fade_setup:    prompt_preview_theme fade white grey blue
>> prompt_bigfade_setup:    prompt_preview_theme bigfade red white grey white
>>
>> "colors" defines "grey" so as not to break those preview defaults, and
>> defines "gray" because some people spell differently.
>>
>> > When grey is
>> > specified, the color defaults to the default color of the virtual terminal you are using.
>>
>> I think that's because the virtual terminal is overriding "black".
>> Both gray and grey are defined as being identical to black.  Only the
>> xterm extended "bright" variants are actually gray.
>
> First, I'm no C programmer so I could have missed something. I knew enough C to allow
> me to be a Unix/Linux system administrator and install patches and to occasionally gen
> my own patch, when needed. Looking through prompt.c I find the following:
>
> /* Defines standard ANSI colour names in index order */
> static const char *ansi_colours[] = {
>     "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white",
>     "default", NULL
> };
>
> Grey/gray aren't defined as far as "I" can tell, anywhere. Should it?

You keep changing the context of the discussion.  Everything you
excerpted from my previous message is about prompt themes and the
colors function.  I keep repeating that this has nothing to do with
the C code / the built-in prompt coloring.  The colors function
defines fg[grey] fg[gray] bg[grey] bg[grey] etc.

> But what is more interesting, it appears that prompt doesn't depend on
> the "colors" function.

We're confusing things again.  No, the built-in prompts do not depend
on the colors function.  Also no, the prompt themes typically do not
require the colors function.  In fact the only one that pretends to is
mine (prompt bart) and only because it presumes the fg array might
already exist.  However, many of the themes accept parameters, and you
can use the arrays created by the colors function to get those values.

> What is also interesting, prompt can output all colors defined by "number"
> instead of a color name. e.g. 1 for red 9 for bright-red ...

Exactly, which is why you can use $color[grey] or
$color[bg-bright-red] to get a number.  But that number is the same
for grey and gray as $color[black].


      reply	other threads:[~2023-09-20  1:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 22:18 Jim
2023-08-17 23:23 ` Bart Schaefer
2023-08-23  0:37   ` Jim
2023-08-23  4:20     ` Bart Schaefer
2023-08-23 12:42       ` Jim
2023-08-24  3:45         ` Bart Schaefer
2023-09-20  1:15           ` Jim
2023-09-20  1:56             ` Bart Schaefer [this message]

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='CAH+w=7Y0SLa72Sr-5iOU8p4euQrLtKxUkxyoSsGUpMkfMjADtA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=linuxtechguy@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).