Subject: Re: command-line editing and "standard" shells....
To: None <current-users@netbsd.org>
From: Simon J. Gerraty <sjg@quick.com.au>
List: current-users
Date: 03/19/1999 14:50:29
> > In real Ksh Version M-12/28/93f, which anyone running NetBSD/i386 or
> > NetBSD/sparc can download for essentially free and run, I've not yet
> > been able to get the cursor key bindings settings to work, though they
> > should work according to the manual page:

>From my /etc/ksh.kshrc

		case "$KSH_VERSION" in
		*PD*)	# PD ksh
			case "$KSH_VERSION" in
			*5.*)	[ -r /etc/ksh.cdhist ] && . /etc/ksh.cdhist
			esac
			case "$TERM" in
			pc3|xterm*|dtterm*)
				# bind arrow keys
				bind '^[['=prefix-2
				bind '^XA'=up-history
				bind '^XB'=down-history
				bind '^XC'=forward-char
				bind '^XD'=backward-char
				;;
			esac
			;;
		*)	# real ksh ?
			[ -r /etc/ksh.cdhist ] && . /etc/ksh.cdhist
			set -o trackall
			case "$TERM" in
			vt*|xterm*|dtterm*)
				# Kevin Gallagher in comp.emacs!
				alias	 __A= # up arrow
				alias	 __B= # down arrow
				alias	 __C= # right arrow
				alias	 __D= # left arrow
				;;
			esac
			;;
		esac
	

Those are litteral Control-P etc for real ksh.
FYI /etc/ksh.cdhist provides a very cool cd history mechanism - one reason
I handed over maintenance of pd-ksh - to the dudes who had added arrays.

My /etc/profile and /etc/ksh.* are included in the configs tree example
archive at: ftp://ftp.quick.com.au/pub/unix/configs-example.cpio.gz

--sjg