Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #239711

Re: Why ``color_prompt`` is only set for ``xterm``?

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: Why ``color_prompt`` is only set for ``xterm``?
Date 2021-09-05 15:10 +0200
Message-ID <CU04i-1ex-9@gated-at.bofh.it> (permalink)
References <CT562-5UL-1@gated-at.bofh.it> <CT5pn-61K-3@gated-at.bofh.it> <CT6v8-6FH-3@gated-at.bofh.it> <CTRX3-4q2-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Sep 04, 2021 at 11:23:48PM -0500, David Wright wrote:
> $ cat /var/local/lib/myhosts/colours/axis 
> 5 magenta bbarbutton=white,magenta,none:bbarhotkey=magenta,white,none
> $ 
> 
> 5 is for ANSI colours,
> magenta is for, eg emacs, mutt, etc,
> bbarbutton is for mc.
> 
> The lines from /root/.bashrc are:
> 
> if [[ $- = *i* ]]; then
> 
>     export PROMPT_COMMAND='Myprompt="$? " && [ "$Myprompt" = "0 " ] && Myprompt=""'
> 
>     # read value from file, and sanitise it
>     Hue=$(head -c 1 /var/local/lib/myhosts/colours/"$HOSTNAME")
>     if grep -q ·"$Hue"· <<<"·0·1·2·3·4·5·6·7·8·9·"; then

It's strange that you used shell builtins for the $- check but not
for this check.

read -r Hue _ < /var/local/lib/myhosts/colours/"$HOSTNAME"
if [[ $Hue = [0-9] ]]; then

Or if you happen to use the other fields of that file later in the script,
then change the read command to store all 3 fields in shell variables.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Why ``color_prompt`` is only set for ``xterm``? IL Ka <kazakevichilya@gmail.com> - 2021-09-03 02:20 +0200
  Re: Why ``color_prompt`` is only set for ``xterm``? David Wright <deblis@lionunicorn.co.uk> - 2021-09-03 02:40 +0200
    Re: Why ``color_prompt`` is only set for ``xterm``? Nicholas Geovanis <nickgeovanis@gmail.com> - 2021-09-03 03:10 +0200
    Re: Why ``color_prompt`` is only set for ``xterm``? piorunz <piorunz@gmx.com> - 2021-09-03 03:50 +0200
      Re: Why ``color_prompt`` is only set for ``xterm``? Mark Neyhart <Mark.Neyhart@akleg.gov> - 2021-09-03 22:00 +0200
        Re: Why ``color_prompt`` is only set for ``xterm``? (colored prompt examples) Intense Red <intnsred@golgotha.net> - 2021-09-05 07:30 +0200
          Re: Why ``color_prompt`` is only set for ``xterm``? (colored prompt examples) Cindy Sue Causey <butterflybytes@gmail.com> - 2021-09-05 14:20 +0200
          Re: Why ``color_prompt`` is only set for ``xterm``? (colored prompt  examples) Greg Wooledge <greg@wooledge.org> - 2021-09-05 15:10 +0200
            Re: Why ``color_prompt`` is only set for ``xterm``? (colored prompt examples) Cindy Sue Causey <butterflybytes@gmail.com> - 2021-09-05 15:40 +0200
              Re: Why ``color_prompt`` is only set for ``xterm``? (colored prompt  examples) Greg Wooledge <greg@wooledge.org> - 2021-09-05 15:50 +0200
      Re: Why ``color_prompt`` is only set for ``xterm``? David Wright <deblis@lionunicorn.co.uk> - 2021-09-05 06:30 +0200
        Re: Why ``color_prompt`` is only set for ``xterm``? Greg Wooledge <greg@wooledge.org> - 2021-09-05 15:10 +0200
          Re: Why ``color_prompt`` is only set for ``xterm``? David Wright <deblis@lionunicorn.co.uk> - 2021-09-07 17:10 +0200
    Re: Why ``color_prompt`` is only set for ``xterm``? Nate Bargmann <n0nb@n0nb.us> - 2021-09-05 18:50 +0200
    Re: Why ``color_prompt`` is only set for ``xterm``? Andrei POPESCU <andreimpopescu@gmail.com> - 2021-09-07 20:40 +0200

csiph-web