On Thu, Sep 21, 2006 at 12:35:07PM +0200, Jan Willem Stumpel wrote:
> >> F6 produces ~ shift-F6 produces ;2~ control-F6 produces ;5~
> >>
> >> This is no good. "Special key" combinations, like function
> >> keys, should either do something functional (hopefully
> >> well-documented), or they should do nothing. They should
> >> never leave random rubbish in the text.
> >
> > Well, yes, that's why terminfo exists, but if the translation
> > is incomplete, you can see bugs like that. If you have a list
> > of exact X key codes passed by terminals, you should submit it
> > for inclusion.
>
> Do you mean that this is a bug in ncurses/terminfo? Or in xterm? I
> am not quite sure what you mean by "exact X key codes" and
> "inclusion".
>
> I noticed that, e.g., control-pageup in xterm generates
> "ESC[5;5~". Only the last part of this string, namely "5~", is
> passed on (and inserted into the text) by joe.
Well, it's simple, the program receives each keypress encoded. That is, an
"a" is usually encoded as an "a", but a Ctrl+PgUp is encoded as "^[5;5" as
you mention. This code isn't rubbish, it's just a representation of that
keypress which is defined by the terminal type.
If you have a look at joerc, you'll notice numerous redefinitions such as:
home ^[ [ 1 ~ Putty, Linux, Cygwin
home ^[ [ H Xterm, Konsole, SCO
home ^[ O H gnome-terminal
home ^[ [ 7 ~ RxVT
home ^# SP A Amiga
As you can see, this is basically one big mess, and it goes back a long way.
Various terminals define keys differently, and if joe doesn't track them
closely, it can fall behind all too easily.
Heck, even it joe did nothing once Ctrl+PgUp was pressed, someone could
still file a bug report saying "but I want it to do insert this exact byte
code when I press that!", and claim that such input behaviour is
"non-robust" because it completely failed to handle their input.
I'm sorry if I sound crass, but I was a bit annoyed by your somewhat casual
description of a problem as "leaving random rubbish in the text", where the
issue is actually triggered by the user not paying a modicum of attention
while typing.
--
2. That which causes joy or happiness.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]