bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

putty terminfo wrong regarding cursor keys?


From: Moritz Bunkus
Subject: putty terminfo wrong regarding cursor keys?
Date: Wed, 4 Jan 2017 19:34:37 +0100
User-agent: NeoMutt/20160916 (1.7.0)

Hey,

it seems to me that the putty terminfo files are wrong about the cursor
keys. I'm currently using the latest putty available from its home
page[1], v0.67 beta. Before reporting the following I've made sure to
erase all of putty's stored settings from the registry, and I've created
a whole new user to test with on my Arch Linux box.

On Arch Linux I'm currently using Arch's ncurses 6.0+20161224-1
package. It does contain a terminfo file for putty in
/lib/terminfo/p/putty.

The only setting I've changed in putty is the TERM setting ("Connection"
→ "Data" → "Terminal-type string") which I've set to "putty" before
connecting.

Here's what "cat -v" shows:

• cursor left: ^[[D
• cursor right: ^[[C
• cursor up: ^[[A
• cursor down: ^[[B

• shift cursor left: ^[OD
• shift cursor right: ^[OC
• shift cursor up: ^[OA
• shift cursor down: ^[OB

Now let's compare that with the terminfo settings. I've run "tput
<keyname> | cat -v" for each key. Here are the results:

• cursor left (kcub1): ^[OD
• cursor right (kcuf1): ^[OC
• cursor up (kcuu1): ^[OA
• cursor down (kcud1): ^[OD

• shift cursor left (kLFT): ^[[D
• shift cursor right (kRIT): ^[[C

This looks swapped regarding shift.

The result is that without any further configuration via e.g. .inputrc I
cannot use the cursor keys in bash, other applications have similar
problems.

Am I completely off track here? I know very little about terminfo,
terminal emulation etc, so that's definitely a possibility! Or does the
putty terminfo really have such a fundamental issue?

I'll be glad to provide more information or to try different
things. I'll even work on and provide a patch if someone can tell me how
to get started (meaning: where do I find the plain-text definitions, how
do I test them; I can use VCSs and "diff" just fine).

Thanks!

Kind regards,
mosu

[1]  http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]