On Tue, 2006-07-25 at 19:48 +0200, LeVA wrote:
...
> This is working, so I started from there. I've added the colour codes,
> but pdksh doesn't handle them.
>
> C'mon, I can't beleive that nobody is using the korn shell :)
This is not a tutorial or anything and most of this can be found
googling, but this is my prompt:
PS1='^[]0;[EMAIL PROTECTED] ${PWD##*/}^G^M^[[0;[EMAIL PROTECTED]
${PWD##*/}]$^[[m '
Note that the ^[ and ^G in the prompt string are single characters for
ESC and BEL (can be entered in emacs using C-q ESC and C-q C-g). The
^M is a carriage return (C-q C-m in emacs), and needs to be used after
other escape characters in the prompt, so ksh can determine the screen
width properly. I couldn't figure out a way to enter these control
characters with vi, but I didn't try too terribly hard either. The
${PWD##*/} is a ksh construct to get the basename of the directory you
are in.
This part sets the title:
^[]0;[EMAIL PROTECTED] ${PWD##*/}^G^M
This part set the prompt (with color):
^[[0;[EMAIL PROTECTED] ${PWD##*/}]$^[[m
So a no frills color prompt without the title might be:
PS1='^[[0;[EMAIL PROTECTED] ${PWD##*/}]$^[[m '
Jamie Strandboge
--
Anemone Computing
http://www.anemonecomputing.com/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]