Output color

Any idea how to type Esc sequence that change color of my output to pterm
in QNX 6.1
(in QNX 4.xx when I type for TERM=qnxm
echo ‘\033\100\062\060Instalation successful’
I get green foreground and black background
or for TERM=qansi-m
echo ‘\233\075\062\106Instalation successful’
and I get the same result
But in QNX6.1 it doesn’t work. I read devc-con helpfile…

(CSI [n[;n]] ]} 9B [n [3B n]…] 5D Set default 1=underline
2=half-intensity 8=colorset (default=none) ???

Hi Kamil,

Any idea how to type Esc sequence that change color of my output to pterm
in QNX 6.1
(in QNX 4.xx when I type for TERM=qnxm
echo ‘\033\100\062\060Instalation successful’
I get green foreground and black background
or for TERM=qansi-m
echo ‘\233\075\062\106Instalation successful’
and I get the same result
But in QNX6.1 it doesn’t work. I read devc-con helpfile…

(CSI [n[;n]] ]} 9B [n [3B n]…] 5D Set default 1=underline
2=half-intensity 8=colorset (default=none) ???

The one you actually want is this -

{CSI [n[;n]…] m} 9B [n[3B n]…] 6D Select Graphic Rendition (See
below) (default = 0)

In 7 bit mode, CSI (Contrl Sequence Introducer) is ESC [ (\e[ or \033[),
while in 8 bit it is 0x9b (or \233).

It’s then followed by a list of numbers seperated by a semicolon, and
ending with a ‘m’.

So to set the foreground colour to a bold green, you would output -
‘\e[32;1m’

The 30+2 is the foreground colour (2 is green), and 1 sets bold.

For a bold blue with a black background -
‘\e[34;1;40m’

You can find the other commands you can use in the devc-con docs, under
Graphic rendition. You might need to experiment how you are printing
out the CSI sequence, depending on the shell and what command you’re
using to print.


Julian Kinraid

Thanks Julian,
it works…
When you know it’s easy :slight_smile:

<jkinraid@clear.net.nz> napísal v správe:9o4qd6$iss$1@inn.qnx.com

Hi Kamil,

Any idea how to type Esc sequence that change color of my output to
pterm
in QNX 6.1
(in QNX 4.xx when I type for TERM=qnxm
echo ‘\033\100\062\060Instalation successful’
I get green foreground and black background
or for TERM=qansi-m
echo ‘\233\075\062\106Instalation successful’
and I get the same result
But in QNX6.1 it doesn’t work. I read devc-con helpfile…

(CSI [n[;n]] ]} 9B [n [3B n]…] 5D Set default 1=underline
2=half-intensity 8=colorset (default=none) ???

The one you actually want is this -

{CSI [n[;n]…] m} 9B [n[3B n]…] 6D Select Graphic Rendition (See
below) (default = 0)

In 7 bit mode, CSI (Contrl Sequence Introducer) is ESC [ (\e[ or \033[),
while in 8 bit it is 0x9b (or \233).

It’s then followed by a list of numbers seperated by a semicolon, and
ending with a ‘m’.

So to set the foreground colour to a bold green, you would output -
‘\e[32;1m’

The 30+2 is the foreground colour (2 is green), and 1 sets bold.

For a bold blue with a black background -
‘\e[34;1;40m’

You can find the other commands you can use in the devc-con docs, under
Graphic rendition. You might need to experiment how you are printing
out the CSI sequence, depending on the shell and what command you’re
using to print.


Julian Kinraid