Operating System - HP-UX
1752565 Members
5555 Online
108788 Solutions
New Discussion юеВ

how to display standard output in inverse video

 
SOLVED
Go to solution
Mladen Despic
Honored Contributor

how to display standard output in inverse video

Do you know a simple way to format text as inverse video in your vt100 or hpterm telnet session?
5 REPLIES 5
RAC_1
Honored Contributor
Solution

Re: how to display standard output in inverse video

tput smso--to start it
then tput rmso to end it.

Anil
There is no substitute to HARDWORK
curt larson_1
Honored Contributor

Re: how to display standard output in inverse video

you could look at this

HV=$(/usr/bin/tput smso 2>/dev/null)
IV=$(/usr/bin/tput bold 2>/dev/null)
EE=$(/usr/bin/tput sgr0 2>/dev/null)

print "${HV}$(hostname)${IV}$PWD${EE} >>!"
john korterman
Honored Contributor

Re: how to display standard output in inverse video

Hi,
to see your options:
# untic
on my terminal I can use:
# tput rev
and
# tput sgr0
to end it.

regards,
John K.
it would be nice if you always got a second chance
Alzhy
Honored Contributor

Re: how to display standard output in inverse video

Or you can also use ANSI ESC codes for inverse video and misc. ANSI screen behaviour including colors:

See this link:

http://www.termsys.demon.co.uk/vtansi.htm

Hakuna Matata.
Bill Hassell
Honored Contributor

Re: how to display standard output in inverse video

Just a note about using escape sequences in a script or program. It will always be wrong when someone with a different terminal logs in. That's the whole idea behind the $TERM variable and the Curses library (which tput uses). When you login, the TERM variable should always be set explicitly by ttytype. Unfortunately, the HP standard profiles check if $TERM has already been set and for telnet (not serial ports) $TERM can be set by the local client...and will always be wrong or incompatible. Make sure ttytype is always run at login as in:

eval $(ttytype -a -s)

Now you can use generic names such as bold or blink for the tput command and it will work correctly on HP terminals, a real DEC VT100 (anyone ever seen one?) and pretenders like Windows hyperterminal.


Bill Hassell, sysadmin