zsh-workers
 help / color / mirror / code / Atom feed
From: Jim <linux.tech.guy@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: devs <zsh-workers@zsh.org>
Subject: Re: prompt colors bug? also possible feature add
Date: Tue, 19 Sep 2023 20:15:19 -0500	[thread overview]
Message-ID: <CA+rB6GKoxeFgvc7Deork3Ek2tFXz4Wg6SFKpvj2a35yhgY+fJQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7bDjgbmNGLyCfp7Yj7ATMM_5cxpk0i2AF6fLUFyjdSnJA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]

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?
That is for someone who knows more about this than I do.

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

I commented out my prompt code in my .zshrc file.
Opened a new terminal.

% unset fg bg fg_bold  # cleared all colors associative arrays
% print -- ${fg[yellow]}This is a test  # outputs the terminal's default
color not yellow

Initiated prompts:
% autoload -Uz promptinit && promptinit
% prompt adam2

Ran several tests using:

% prompt_preview_theme fade <color1> <color2> <color3>

Substituted different color names for <colorN>

Prompt outputs all colors as defined in prompt.c.
Did not include gray/grey.

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 ...
The linux console will output colors 0..15
All virtual terminals(that I tested) outputs all 256 colors:  0..255

Anyway, just passing on what I found.

Regards,

Jim

[-- Attachment #2: Type: text/html, Size: 4361 bytes --]

  reply	other threads:[~2023-09-20  1:16 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 [this message]
2023-09-20  1:56             ` Bart Schaefer

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=CA+rB6GKoxeFgvc7Deork3Ek2tFXz4Wg6SFKpvj2a35yhgY+fJQ@mail.gmail.com \
    --to=linux.tech.guy@gmail.com \
    --cc=linuxtechguy@gmail.com \
    --cc=schaefer@brasslantern.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).