Subject: Re: Using color in PS1 of the Korn Shell with ANSI escape codes
To: None <netbsd-users@netbsd.org>
From: Gilbert Fernandes <gilbert.fernandes@spamcop.net>
List: netbsd-users
Date: 12/27/2005 02:39:51
>    The "\[ <unprintable stuff goes here \]" solution is a bash-ism then,
> I
> take it?

I don't know exactly. I have been Googling around for tips and examples and
the problem is most people seem to use bash.

I use Korn. I really disklike bash for plenty reasons, especially their
habit to prefix their scripts with /bin/sh instead of /bin/bash (unless
this has changed recently) which leads to annoyances when mixing real sh
scripts in a legacy server where bash has been installed for a user, which
thens tried to use real-sh scripts from his bash which tries to run them
happily with results neither the user nor I did appreciate ;)

Well. I don't know exactly how to insert ANSI escape sequences exactly from
a Korn point of view.

Most people advised me caution about those, because they f*ck up the prompt
size. I do know that screen has a trick around this (by inserting control-A
sequences before and after those escape sequences). So I'm using a non-color
prompt now :

PS1='{$PWD}
[$LOGNAME][!] '

I combine it with screen so I have the date, time, load and other not so
useful information on screen at all time :o)

(screenrc and other dotfiles available on request)

--
unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ;
fsck ; umount ; sleep