pterm color

Is there a way to change the pterm background color (to something
like blue or gray) with a command line command?

I want it to be extremely obvious that I’m working on a particular
branch of code when I’m in one window. I have an alias that
already takes me to that branch of the code. This command would
be added to the alias.

Thanks!
Barry

I partially got it with a pterm.pal file, but I can’t find any
information on what the numbers are supposed to be for or what
range they are to be in.

Anyone?

Thanks,
Barry

Barry Robertson wrote:

Is there a way to change the pterm background color (to something
like blue or gray) with a command line command?

I want it to be extremely obvious that I’m working on a particular
branch of code when I’m in one window. I have an alias that
already takes me to that branch of the code. This command would
be added to the alias.

Thanks!
Barry

I’m not sure exactly what you’re trying to achieve, but you can do some
basic effects simply by using the standard ANSI or QNX “escape” sequences.

For example, to get some really ugly colours try

$ echo \033[=2G\033[=4F # ANSI emulation mode

or

$ echo \033[@42 # QNX emulation mode

The terminal control sequences are documented in the helpviewer under
“Dev.ansi” and “Dev.con” respectively.

Rob Rutherford


“Barry Robertson” <brobertson@SoftwareRemodeling.com> wrote in message
news:397637D9.FB71169@SoftwareRemodeling.com

I partially got it with a pterm.pal file, but I can’t find any
information on what the numbers are supposed to be for or what
range they are to be in.

Anyone?

Thanks,
Barry

Barry Robertson wrote:

Is there a way to change the pterm background color (to something
like blue or gray) with a command line command?

I want it to be extremely obvious that I’m working on a particular
branch of code when I’m in one window. I have an alias that
already takes me to that branch of the code. This command would
be added to the alias.

Thanks!
Barry

Barry Robertson <brobertson@softwareremodeling.com> wrote:
: I partially got it with a pterm.pal file, but I can’t find any
: information on what the numbers are supposed to be for or what
: range they are to be in.

Here’s something that was added to the docs fairly recently:

The palette file can be either a binary file containing sixteen 32-bit
entries or a text file containing sixteen 8-digit hexadecimal numbers
separated by newlines (and terminated with a single newline). If the
length of the file is neither 64 nor 144 bytes, the file is assumed invalid.

The palette file is capable of displaying 16 colors: 8 “normal” colors and
8 “bright” colors in the same way that a standard CGA/VGA does.
Color numbers are indexes into this array. The default array has 16
elements corresponding to 16 standard CGA colors:

Index Color


0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 WHITE (light grey)
8 BRIGHT BLACK (dark grey)
9 BRIGHT BLUE
10 BRIGHT GREEN
11 BRIGHT CYAN
12 BRIGHT RED
13 BRIGHT MAGENTA
14 BRIGHT BROWN (yellow)
15 BRIGHT WHITE


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.

Steve,

Thanks for the color indexes. Is there any information on what
each digit of the 8-digit hexadecimal numbers refer to (ie.
background color, text color)?

Also, what I’d like to do is be looking at a pterm window (I seem
to be in ANSI mode), let’s say it’s background is black, and issue
a command to my current pterm to change the background color for
the whole window to something like blue.

Idea’s? I’ve looked in our documentation, but haven’t come up
with anything. I thought the -L (don’t create a new session)
might be the ticket, but didn’t seem to work. I was trying to
use a new pterm command that assumed the current window.

Thanks for your help,
Barry

Steve Reid wrote:

Barry Robertson <> brobertson@softwareremodeling.com> > wrote:
: I partially got it with a pterm.pal file, but I can’t find any
: information on what the numbers are supposed to be for or what
: range they are to be in.

Here’s something that was added to the docs fairly recently:

The palette file can be either a binary file containing sixteen 32-bit
entries or a text file containing sixteen 8-digit hexadecimal numbers
separated by newlines (and terminated with a single newline). If the
length of the file is neither 64 nor 144 bytes, the file is assumed invalid.

The palette file is capable of displaying 16 colors: 8 “normal” colors and
8 “bright” colors in the same way that a standard CGA/VGA does.
Color numbers are indexes into this array. The default array has 16
elements corresponding to 16 standard CGA colors:

Index Color


0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 WHITE (light grey)
8 BRIGHT BLACK (dark grey)
9 BRIGHT BLUE
10 BRIGHT GREEN
11 BRIGHT CYAN
12 BRIGHT RED
13 BRIGHT MAGENTA
14 BRIGHT BROWN (yellow)
15 BRIGHT WHITE


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.


__| _ \ _ | Barry Robertson
_
\ | | | Software Consultant Phone: 972-758-9349
| __ < | Software Remodeling, Inc. Fax: 972-964-7524
___/ _| __| brobertson@SoftwareRemodeling.com

There is a pterm color editor as part of the CPhoton example programs. It
only works with ascii pterm.pal files.
Please see http://www.qrts.com/products/cphoton/ptce.shtml
To change the pterm.pal file only affects new pterms.
Markus


Markus Loffler
Quality Real-Time Systems
e-mail: markus@qrts.com
http://qrts.com



“Steve Reid” <stever@qnx.com> wrote in message
news:8l6v32$1a2$1@nntp.qnx.com

Barry Robertson <> brobertson@softwareremodeling.com> > wrote:
: I partially got it with a pterm.pal file, but I can’t find any
: information on what the numbers are supposed to be for or what
: range they are to be in.

Here’s something that was added to the docs fairly recently:

The palette file can be either a binary file containing sixteen 32-bit
entries or a text file containing sixteen 8-digit hexadecimal numbers
separated by newlines (and terminated with a single newline). If the
length of the file is neither 64 nor 144 bytes, the file is assumed
invalid.

The palette file is capable of displaying 16 colors: 8 “normal” colors and
8 “bright” colors in the same way that a standard CGA/VGA does.
Color numbers are indexes into this array. The default array has 16
elements corresponding to 16 standard CGA colors:

Index Color


0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 WHITE (light grey)
8 BRIGHT BLACK (dark grey)
9 BRIGHT BLUE
10 BRIGHT GREEN
11 BRIGHT CYAN
12 BRIGHT RED
13 BRIGHT MAGENTA
14 BRIGHT BROWN (yellow)
15 BRIGHT WHITE


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.

[My previous post seemed to get lost. Sorry if you see this twice]

I’m not sure if this is what you are after, but did you try something as
simple as:

$ echo \033[=4G

This will work for ANSI mode. For QNX emulation you need something like

$ echo \033@73

The complete terminal control sequences for ANSI and QNX are documented in
the online docs for Dev.ansi and Dev.con respectively.

Rob Rutherford


“Barry Robertson” <brobertson@SoftwareRemodeling.com> wrote in message
news:39770685.63A3F33C@SoftwareRemodeling.com

Steve,

Thanks for the color indexes. Is there any information on what
each digit of the 8-digit hexadecimal numbers refer to (ie.
background color, text color)?

Also, what I’d like to do is be looking at a pterm window (I seem
to be in ANSI mode), let’s say it’s background is black, and issue
a command to my current pterm to change the background color for
the whole window to something like blue.

Idea’s? I’ve looked in our documentation, but haven’t come up
with anything. I thought the -L (don’t create a new session)
might be the ticket, but didn’t seem to work. I was trying to
use a new pterm command that assumed the current window.

Thanks for your help,
Barry

Steve Reid wrote:

Barry Robertson <> brobertson@softwareremodeling.com> > wrote:
: I partially got it with a pterm.pal file, but I can’t find any
: information on what the numbers are supposed to be for or what
: range they are to be in.

Here’s something that was added to the docs fairly recently:

The palette file can be either a binary file containing sixteen 32-bit
entries or a text file containing sixteen 8-digit hexadecimal numbers
separated by newlines (and terminated with a single newline). If the
length of the file is neither 64 nor 144 bytes, the file is assumed
invalid.

The palette file is capable of displaying 16 colors: 8 “normal” colors
and
8 “bright” colors in the same way that a standard CGA/VGA does.
Color numbers are indexes into this array. The default array has 16
elements corresponding to 16 standard CGA colors:

Index Color


0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 WHITE (light grey)
8 BRIGHT BLACK (dark grey)
9 BRIGHT BLUE
10 BRIGHT GREEN
11 BRIGHT CYAN
12 BRIGHT RED
13 BRIGHT MAGENTA
14 BRIGHT BROWN (yellow)
15 BRIGHT WHITE


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.


__| _ \ _ | Barry Robertson
_
\ | | | Software Consultant Phone: 972-758-9349
| __ < | Software Remodeling, Inc. Fax: 972-964-7524
___/ _| __| > brobertson@SoftwareRemodeling.com

To everyone who’s helped, thank you. At the moment, I’m using the
ANSI sequence below with an additional \033c to clear the screen,
resulting in a background color change to the entire window.

Thanks again!
-Barry

Robert Rutherford wrote:

[My previous post seemed to get lost. Sorry if you see this twice]

I’m not sure if this is what you are after, but did you try something as
simple as:

$ echo \033[=4G

This will work for ANSI mode. For QNX emulation you need something like

$ echo \033@73

The complete terminal control sequences for ANSI and QNX are documented in
the online docs for Dev.ansi and Dev.con respectively.

Rob Rutherford

“Barry Robertson” <> brobertson@SoftwareRemodeling.com> > wrote in message
news:> 39770685.63A3F33C@SoftwareRemodeling.com> …
Steve,

Thanks for the color indexes. Is there any information on what
each digit of the 8-digit hexadecimal numbers refer to (ie.
background color, text color)?

Also, what I’d like to do is be looking at a pterm window (I seem
to be in ANSI mode), let’s say it’s background is black, and issue
a command to my current pterm to change the background color for
the whole window to something like blue.

Idea’s? I’ve looked in our documentation, but haven’t come up
with anything. I thought the -L (don’t create a new session)
might be the ticket, but didn’t seem to work. I was trying to
use a new pterm command that assumed the current window.

Thanks for your help,
Barry

Steve Reid wrote:

Barry Robertson <> brobertson@softwareremodeling.com> > wrote:
: I partially got it with a pterm.pal file, but I can’t find any
: information on what the numbers are supposed to be for or what
: range they are to be in.

Here’s something that was added to the docs fairly recently:

The palette file can be either a binary file containing sixteen 32-bit
entries or a text file containing sixteen 8-digit hexadecimal numbers
separated by newlines (and terminated with a single newline). If the
length of the file is neither 64 nor 144 bytes, the file is assumed
invalid.

The palette file is capable of displaying 16 colors: 8 “normal” colors
and
8 “bright” colors in the same way that a standard CGA/VGA does.
Color numbers are indexes into this array. The default array has 16
elements corresponding to 16 standard CGA colors:

Index Color


0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 WHITE (light grey)
8 BRIGHT BLACK (dark grey)
9 BRIGHT BLUE
10 BRIGHT GREEN
11 BRIGHT CYAN
12 BRIGHT RED
13 BRIGHT MAGENTA
14 BRIGHT BROWN (yellow)
15 BRIGHT WHITE


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.


__| _ \ _ | Barry Robertson
_
\ | | | Software Consultant Phone: 972-758-9349
| __ < | Software Remodeling, Inc. Fax: 972-964-7524
___/ _| __| > brobertson@SoftwareRemodeling.com


__| _ \ _ | Barry Robertson
_
\ | | | Software Consultant Phone: 972-758-9349
| __ < | Software Remodeling, Inc. Fax: 972-964-7524
___/ _| __| brobertson@SoftwareRemodeling.com

Barry Robertson <brobertson@SoftwareRemodeling.com> writes:

Is there a way to change the pterm background color (to something
like blue or gray) with a command line command?

I want it to be extremely obvious that I’m working on a particular
branch of code when I’m in one window. I have an alias that
already takes me to that branch of the code. This command would
be added to the alias.

I use the qnxm pterm type in Photon. I put the following shell
functions in my .profile (or $ENV file).

function color
{
if [ “$2” = “” ] ; then
echo “Usage: color foreground background [highligh]”
echo " Each color can be one of:"
echo " 0 - black"
echo " 1 - blue"
echo " 2 - green"
echo " 3 - cyan"
echo " 4 - red"
echo " 5 - magenta"
echo " 6 - brown"
echo " 7 - white"
else
FOREGROUND=$1
BACKGROUND=$2
HIGHLIGHT=${3:-$1}
echo “@$1$2!$1$2S\c”
fi
}

function white
{
color 0 7 7
}

function green
{
color 2 0 6
}

function blue
{
color 7 1 6
}

function normal
{
stty +fix

Turn of flashing, inverse, highlight, underline

echo ‘}]>)’
white
}

if [ $HOME = / -o $HOME = /// -o $HOME = /root ] ; then
USERNAME=root
PROMPT=’# ’
else
USERNAME=$LOGNAME
PROMPT=’> ’
fi

case $TERM in
qnx)
PS1="<@${HIGHLIGHT}${BACKGROUND}${USERNAME}@${NODE}:$PWD$PROMPT>R"
normal
;;
*)
PS1="${USERNAME}@${NODE}:$PWD$PROMPT"

turn off line editing. It echos the command line in an emacs shell

if [ ${TERM} = “emacs” ] ; then
set +o emacs
else
set -o emacs
fi
;;
esac


\

Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N 6S2
Email: andrew@cogent.ca WWW: http://www.cogent.ca