It is currently Sat, 04 Dec 2021 18:39:36 GMT



 
Author Message
 ksh reverse video prompt
how to set up the ksh proompt in reverse video? thanks

_Yuming Ma,



 Sun, 20 Jul 2003 02:25:45 GMT   
 ksh reverse video prompt

That will depend on your terminal type, different terminals will
require different escape sequences.

You will have to embed the actual escape sequence into PS1, first to
set it, then to clear it (or your command output will be reverse too).
To see the characters you need, type these commands:

tput rev | od -c
tput sgr0 | od -c

The output for an xterm for those is:

033 [ 7 m
and
033 [ m 033 ( B

Other TERM types will have different escape sequences (or maybe not).

The 033 is an escape character, entered by typing ctrl-v ctrl-[

To get a prompt like this: [user@host] /current_dir
in reverse for an xterm, the sequence would be:

PS1='^V^[[7m[${LOGNAME##}@'`uname -n`'] ${PWD}> ^V^[[m^V^[(B'

Pasting that won't work; you have to actually hold the ctrl key and
then press "v" and then "[" in the appropriate places.  Make sure
you use the correct quotes.  Take note of the exact placement of the
forward and reverse ticks.

The result will look like this before you press enter:

PS1='^[[7m[${LOGNAME##}@'`uname -n`'] ${PWD}> ^[[m^[(B'

Have fun.



 Sun, 20 Jul 2003 03:07:02 GMT   
 
   [ 2 post ] 

Similar Threads

1. ksh reverse vidoe prompt

2. Making prompt display reverse video

3. Reverse-video csh prompt on SunOS xterm?

4. Part II: Setting My Prompt In Reverse Video

5. Reverse video for status-line in ksh

6. reverse alias in ksh?

7. ksh and prompting

8. Changing prompt to reflect new current working directory in ksh

9. ksh prompt question

10. Customize prompt on KSH


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software