Proposed syntax for key sequences

Pavel Roskin proski at gnu.org
Sun Dec 22 07:23:57 UTC 2002


Hello!

> > Just tell me what sequences those keys generate.  You can run
> > dd without arguments and press those keys.

Actually, we are interested in the sequences in the application keypad
mode, so I was wrong.  It makes the difference for xterm, but not for
rxvt.  Please try this command instead of dd:

echo -ne '\e[?1h\e='; dd

> Left: ^[[D
> Ctrl-Left: ^[OD
> Shift-Left: ^[[D
> Alt-Left: ^[^[[D

This is completely different from the Xterm Control Sequences
specification:

http://ftp.xfree86.org/pub/XFree86/4.2.1/doc/ctlseqs.TXT

^[[ (CSI) should be used in the normal mode and ^[O (SS3) in the
application mode, regardless of modifiers.  In fact, Ctrl-arrows on putty
conflict with normal arrows on xterm, not with Shift-arrows as I wrote in
the previous message.

I think the best thing you can do it to ask putty developers to implement
xterm specification for the arrow keys.  You can even try it yourself.

> I'm using WinXP and the 2002-11-18 snapshot of PUTTY. It seems, just the
> Shift cursor keys and normal cursor keys gives the same result, the
> others give back different codes.

Yes, but those codes conflict with xterm, and both putty and xterm set
TERM variable to "xterm".  I believe that xterm keys should have
preference because they are documented.

I'm not going to add any hacks to identify putty.  It's free software and
can be fixed.

> I've tried to test the same under VMWare with UHU-Linux (a hungarian
> Linux distribution), and Left, Shift-Left, Ctrl-Left was the same
> (equals the Left sequence above) with dd, and Alt-Left changed the
> terminal screen. On the other way it was strange for me, that Ctrl-Left
> worked fine in mc and jumped over a word, when I pressed. (?) The
> version of mc in this distribution is 4.5.55, and using S-Lang with
> terminfo database.

The binary version of mc may have support for reading modifiers from X.

-- 
Regards,
Pavel Roskin



More information about the mc-devel mailing list