Subject: Re: CVS commit: basesrc/bin/ksh
To: None <>
From: Joerg Klemenz <>
List: tech-userlevel
Date: 09/29/2002 21:26:45
Greg A. Woods wrote:
> [ On Saturday, September 28, 2002 at 00:59:17 (+0000), Joerg Klemenz wrote: ]
> > Subject: Re: CVS commit: basesrc/bin/ksh
> >
> > > 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.
> I'm using an xterm, but my example should work for all ANSI x3.64
> compatible terminals.

You are right of course. But my original complaint was about the fact
that ksh will fail with 4 byte keysyms. This bug affects rxvt and
unfortunatly the (my) console.

> > The NetBSD console gives ^[[8~
> > for <END> not ^[[F
> A, well then I guess on some versions of NetBSD, including what you're
> using, the console is not ANSI x3.64 compatible.

I have NetBSD/i386 1.6 for the record. Do other versions really give
different keysyms??
BTW: I think I complained about wscons' keysyms here some time ago...
I still don't know why NetBSD actually does produce this syms like
^[[8~ for <END>. /etc/share/termcap suggests this is used only by
rxvt, wscons and some old xterm-v5 or so...

> > I did not say it was errornous. It just sucks.
> > Cursor-addressable terminals have been available for some time now.
> I'm not sure what you're complaining about then.  No matter how you
> manipulate the characters on the screen, the behaviour of a horizonally
> scrolling line editor is going to be essentially exactly the same.  The

I was asking for a wraping line editor, like bash, zsh, etc.

> > > fragment from ~/.profile that I've used for the past ten years:
> > > [..]
> > >
> > I can see from looking at it for 10 seconds that this code fails w/ zsh
> I've never encountered a system where zsh might be the only POSIX-like
> shell available to me, so I've never bothered to test it.  However that
> fragment above will not "fail" with zsh -- it just might not do
> everything you want, which is why I suggested that you look at the
> complete implemenation in my archive.

However you twist it, the fact that sh, ksh and bash share one
.profile causes trouble.
The only clean solution is IMHO a ksh specific rc file. And your code
only tries to emulate what is missing in ksh.  Clever, maybe, but this
is most definitly an error in ksh (and bash too, see the other mail..).

> > it's late...
> You should look again when you've had more sleep!  :-)

Thanks. I'm a lot smarter in the morning. Really.

joerg klemenz <>