Subject: Re: ksh [was: Re: miniroot for NetBSD/i386?]
To: Hubert Feyrer <feyrer@cs.stevens.edu>
From: Igor Sobrado <igor@string1.ciencias.uniovi.es>
List: port-i386
Date: 12/13/2005 10:23:07
In message <Pine.LNX.4.61.0512122127300.1950@m24s24.vlinux.de>, Hubert Feyrer writes:
> 
> IIRC this only works if you do NOT have the VISUAL env var set.
> Kinda strange...

It seems that VISUAL changes the behaviour of the Korn shell on Solaris,
it does not only set the visual editor to be used but also the shell
behaviour.  We can play again with the server of the Geological Sciences
Department:

$ ssh sismica0.geol.uniovi.es
sobrado@sismica0.geol.uniovi.es's password: 
Last login: Tue Dec 13 10:03:28 2005 from geol00.geol.uni
Sun Microsystems Inc.   SunOS 5.9       Generic May 2002
$ set -o emacs
$ VISUAL=vi; export VISUAL

Now it is in vi mode!!! (e.g, <Esc>+n<j> and <Esc>+n<k> are used to
recover history lines now).  In other words,

$ VISUAL=vi; export VISUAL

is equivalent to

$ VISUAL=vi; export VISUAL
$ set -o vi

Ok... it should work with emacs then...

$ ssh sismica0.geol.uniovi.es
sobrado@sismica0.geol.uniovi.es's password: 
Last login: Tue Dec 13 10:08:52 2005 from geol00.geol.uni
Sun Microsystems Inc.   SunOS 5.9       Generic May 2002
$ cat .pro^[^[         <- ksh not working in vi/emacs mode by default
cat: cannot open .pro
$ VISUAL=emacs; export VISUAL
$ cat .pro<Esc><Esc>   <- $ cat .profile... we do not need "set -o emacs" now

Cheers,
Igor.