[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to make colour prompts for pdksh



On Wed, 2006-07-26 at 15:42 +0200, LeVA wrote:
> 2006. July 26. 14:32, James Strandboge:
> > On Tue, 2006-07-25 at 22:59 +0200, LeVA wrote:
> > Are you *sure* that the control characters have been entered
> > correctly? It is not '^' followed by '['.  It must be the single
> > charactor '^['.
> >
> Now that your pointing this out for me :) indeed I was using a '^' char 
> followed by a '['.
> But how can I enter that control character? What is the keycombo for it?

Check my previous email.  I don't know how to do it in vi
(unfortunately), but it can be done in emacs.

...

> When I'm using a login shell, everything is working.
> But when I'm using a non-login shell (in my case Konsole from KDE), then 
> everything gets still sourced from my ~/.profile (so my PS1 
> is 'whatever...') *BUT* the aliases are not working.

It needs to be a login shell, or have ENV set.  From the man page:
       If the basename of the name the shell is called  with  (i.e.,  argv[0])
       starts with - or if the -l option is used, the shell is assumed to be a
       login shell and the shell reads and executes the contents of  /etc/pro‐
       file and $HOME/.profile if they exist and are readable.

       If  the  ENV parameter is set when the shell starts (or, in the case of
       login shells, after any profiles are processed), its value is subjected
       to  parameter,  command,  arithmetic  and  tilde  substitution  and the
       resulting file (if any) is read and executed.  If ENV parameter is  not
       set  (and  not  null) and pdksh was compiled with the DEFAULT_ENV macro
       defined, the file named in that macro is included (after the above men‐
       tioned substitutions have been performed).

So either set konsole up to launch ksh as a login shell, or set ENV
somewhere.  You can test this with:

$ ENV="~/.profile" konsole

Or launch konsole, and do:
$ ksh -l

If you setup .profile the way I suggested (eg, by setting ENV to
be .kshrc), konsole works properly.  For some reason, gnome-terminal
does not do this correctly, but it has a method of launching the shell
as a login session, which works just as well.

Jamie


-- 
Anemone Computing
http://www.anemonecomputing.com/



Reply to: