Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Setting term and psh foreground/background color settings in QNX4
Ref. No. QNX.000009935
Category(ies) Utilities, Configuration
Issue We want to change the foreground and background color of pterm. How do we do this? As of now foreground is always white and background is always black. We want foreground color green on pterm.
What is the way to do this?
Solution There is no command line argument to set the colors. The escape sequences that change colors are listed in the descriptions of Dev.con and Dev.ansi. Here is an example script that changes the colors to black on white:
x09#!/bin/ksh
x09case "$TERM" in
x09qnx*)
x09x09#ESC @ fc bc define the foreground and background color of displayed characters
x09x09#ESC ! fc bc set the fill color
x09x09#0 Black
x09x09#1 Blue
x09x09#2 Green
x09x09#3 Cyan
x09x09#4 Red
x09x09#5 Magneta
x09x09#6 Brown
x09x09#7 White
x09x09printf "