Re: how to make colour prompts for pdksh
2006. July 25. 18:29, Leinier C. Salfran:
> El mar, 25-07-2006 a las 17:01 +0200, LeVA escribió:
> > Hi!
> >
> > I want to make my shell's prompt colourful :)
> >
> > I'm using pdksh. There are tons of information provided by google,
> > but none of them are working.
> >
> > Setting my prompt to:
> > PS1=$'\E[31m'$USER@$'\E[1;33m'`hostname -s`:$'\E[0m>'
> >
> > makes my prompt:
> > $\E[31mleva@$\E[1;33mleva:$\E[0m>
> >
> > The colour codes gets ignored. Is this only working with the
> > original korn shell? Is there colour support for the public domain
> > korn shell?
> >
> Hi .. I never used this but I can say you that you are using 'text
> strings' in that variable .. Everything you put enclosed in ' and "
> is a 'text string' in c, perl, php, bash and others.
>
> PS1=$'\E[31m'$USER@$'\E[1;33m'`hostname -s`:$'\E[0m>'
>
> The result looks like this
>
> PS1=$'\E[31m'$USER@$'\E[1;33m'`hostname -s`:$'\E[0m>'
> $ \E[31m leva@$ \E[1;33m leva :$ \E[0m>
>
> Do you see?
>
> Try to eliminate ' and try .. Maybe it works.
The colourless version of the prompt is working with '' enclosing, and
it is supposed to work (not just by accident :). The problem lays
behind the colour code handling.
My prompt looks like this now:
PS1='@`hostname -s`:$USER($PWD) $ '
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 :)
Daniel
--
LeVA
Reply to: