Operating System - HP-UX
1854981 Members
3736 Online
104108 Solutions
New Discussion

Colors in Telnet Sessions !!

 
Chapaya
Frequent Advisor

Colors in Telnet Sessions !!

Hello ,
How do i set Colors in telnet sessions ?
What commands shuold i add to .profile ?
Eran .
7 REPLIES 7
Bill McNAMARA_1
Honored Contributor

Re: Colors in Telnet Sessions !!

see /etc/rc.config.d/list_mode

alternatively old 3d glasses can be useful.
It works for me (tm)
Khalid A. Al-Tayaran
Valued Contributor

Re: Colors in Telnet Sessions !!


You can use Exceed without modifying files. But you'll have one color for for the text in that particular session. Other servers can have different colors.
David Child_1
Honored Contributor

Re: Colors in Telnet Sessions !!

What do you wish to be in color? (e.g. text=blue, background=black, prompt=red, etc.)

Do you need the colors to be different for different sessions?

Thanks,
David
Steve Steel
Honored Contributor

Re: Colors in Telnet Sessions !!

Hi

export PS1=$($HOME/bin/setPS1)

With a script like this


#!/usr/bin/ksh
# Make certain that the length of time fields is 2-digit:
#set -x
typeset -RZ2 hr min sec

# Get a string which is parsable to the number of seconds.
let SECONDS=$(/usr/bin/date '+3600*%H+60*%M+%S')

s='(hr=(SECONDS/3600)%24)==(min=(SECONDS/60)%60)==(sec=SECONDS%60)'
d=
TIME='"${d[s]}$hr:$min:$sec"'
#export MESSAGE=\\${TIME}':'"On "\\$PWD" "\\$MESSAGE
#echo $TIME $MESSAGE
echo "\e&v4S $LOGNAME \e&v5S $(uname -nmrv) \e&v2S:\e&v4S $MESSAGE
\e&v5S\\$PWD\e&v1S >\e&v0S"



Will give you a prompt in color


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Mark Greene_1
Honored Contributor

Re: Colors in Telnet Sessions !!

See the man pages for tput, untic, and terminfo. You may need to modify the terminal information database, in which case you'll want to look here for that info:

http://www.cs.utk.edu/~shuford/terminal_index.html

which is the most exhuastive repository of terminal information on the net.

HTH
mark
the future will be a lot like now, only later
Helen French
Honored Contributor

Re: Colors in Telnet Sessions !!

What type of terminal are you using? Is it a X Windows session? What type of emulation? Software?
Life is a promise, fulfill it!
David Child_1
Honored Contributor

Re: Colors in Telnet Sessions !!

If you are using an xterm I'm not sure how much you can do. If you are using dtterm you could do something like:

echo '\033[1m\033[33m'

This will turn your text bold and yellow.

bold = \033[1m
yellow = \033[33m
green = \033[32m
red = \033[31m
blue = \033[34m

David