[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: putty terminfo wrong regarding cursor keys?
From: |
Thomas Dickey |
Subject: |
Re: putty terminfo wrong regarding cursor keys? |
Date: |
Sat, 14 Jan 2017 17:41:55 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Jan 04, 2017 at 09:35:00PM -0500, Thomas Dickey wrote:
> On Wed, Jan 04, 2017 at 07:34:37PM +0100, Moritz Bunkus wrote:
> > 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.
>
> odd - it's consistent with the Unix port "pterm", but not the original
> Windows putty.
I misread a check here - they're consistent.
PuTTY starts with its cursor-keys in "normal mode" (by default).
However, terminal descriptions are written for full-screen mode.
The terminal description for PuTTY switches to "application mode".
It's an FAQ -
http://invisible-island.net/ncurses/ncurses.faq.html#cursor_appmode
Generally "normal" mode sends an escape character followed by a '[',
while "application" modes sends an "O" (capital O) instead of '['.
If you run "infocmp -i putty", you'll see something a little more
readable than just "infocmp putty":
is2: {SC}{RSR}{SGR0}{DEC+AWM}{DEC-CKM;SCLM;OM}{rmir}{RC}{DECPNM}\E]R
rs2: {DECANSI}\E["p\E[50;6"p{RIS}{DEC-COLM}\E]R{DEC-1000}
smcup: {DEC+47}
rmcup: \E[2J{DEC-47}
smkx: {DEC+CKM}{DECPAM}
rmkx: {DEC-CKM}{DECPNM}
This line says that the initialization for keypad keys (cursor- and numeric-)
uses application mode for both (the "DEC+CKM" means it enables DECCKM, which
is the cursor-key application mode):
smkx: {DEC+CKM}{DECPAM}
This line says that when not in full-screen mode, it sets the cursor keys
to normal mode:
is2: {SC}{RSR}{SGR0}{DEC+AWM}{DEC-CKM;SCLM;OM}{rmir}{RC}{DECPNM}\E]R
The RIS in the rs2 string does the equivalent.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature