Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight shell prompt

Status
Not open for further replies.

modemer

Technical User
Feb 16, 2005
22
US
Currently I am working on AIX/SUN/HP with tcsh,

set prompt = "%{\033[7m>>\033[m%} "
it will highlight the prompt, but there is a side effect on SUN, when I edit command line with cursor keys and backspace key, the command line is massed up.

Anyone has a good solution?

Thanks
 
Ok, you are talking about tput, how does it work with shell prompt? could you give an example?
 
tput smso #turns on highlighting
tput rmso #turns off hightlighting
 
tput smul #turns on underlining
tput rmul #turns off underlining
 
Thanks khz, looks like it highlights everthing. But I just want to highlight "prompt" :)

Anyway, thanks for your answer.
 
prompt="`uname -n`"
onbold="`tput smso`"
offbold="`tput rmso`"
export PS1="$onbold$prompt$offbold
 
khz, thanks for your example. It works perfectly with ksh. But my original question is for tcsh. Any example? I've tried similar with your example, but it doesn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top