Subject: Re: CVS commit: basesrc/bin/ksh
To: None <tech-userlevel@netbsd.org>
From: Joerg Klemenz <joerg@gmx.net>
List: tech-userlevel
Date: 09/28/2002 00:59:17
Greg A. Woods wrote:
> [ On Friday, September 27, 2002 at 18:07:06 (+0000), Joerg Klemenz wrote: ]
> >
> > home/end/ctrl-arrow won't work, also Fn or ^L etc.
> > Just try (in emacs mode) bind "^[[8~"=end-of-line
> > (bind -m ..=^E won't work too)
> 
> RTFM:
>      [...]
> Since <HOME> is in ANSI x3.64 by default <ESC>[H, and <END> is by
> default <ESC>[F, extending the above suggests:
> 
> 	bind '^XH'=beginning-of-line
> 	bind '^XF'=end-of-line
> 
> And, indeed those to commands alone work just fine (since if I'm not
> mistaken '^[['=prefix-2 is already a default binding).

It is not. I don't know what version of pdksh or NetBSD you are using,
but it certainly doesn't work for me. The NetBSD console gives ^[[8~
for <END> not ^[[F

> > Also the scrolling (non-wrapping) line editor sucks big time.
> 
> It works just fine -- it just works differently than some other
> interactive line editors you might be more familiar with.

I did not say it was errornous. It just sucks.
Cursor-addressable terminals have been available for some time now.

> > Also the lack of a .kshrc file or whatever forces you to put ksh
> > specific stuff in .profile or $ENV and ifdef it out which doesnt
> > always work.
> 
> Huh?  $ENV is standard POSIX shell behaviour and has been a standard
> feature of AT&T ksh for nearly forever (1983?).  You don't get a
> ~/.kshrc file to work by default with AT&T KSH, you have to use $ENV.
> 
> And $ENV does always work reliably if you use it properly:
> 
> fragment from ~/.profile that I've used for the past ten years:
> 
> 	if [ ${RANDOM:-0} -ne ${RANDOM:-0} -a -z "${BASH}" ] ; then
> 		# we're running ksh
> 		if [ -r $HOME/.kshlogin ] ; then
> 			. $HOME/.kshlogin
> 		fi
> 	fi

I can see from looking at it for 10 seconds that this code fails w/ zsh


it's late...

-- 
joerg klemenz <joerg@gmx.net>