Subject: Re: pkg/37173
To: None <wiz@NetBSD.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,>
From: Valeriy E. Ushakov <uwe@stderr.spb.ru>
List: pkgsrc-bugs
Date: 11/17/2007 00:00:06
The following reply was made to PR pkg/37173; it has been noted by GNATS.
From: "Valeriy E. Ushakov" <uwe@stderr.spb.ru>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/37173
Date: Sat, 17 Nov 2007 02:56:27 +0300
Suggested hack makes keypad keys (arrows &co) in tin work for me again.
Our curses has no chance of working with tin, b/c tin does something
in it's curses code that is not strictly legal. In tcurses.c:ReadCh
it does ungetch() on KEY_* values while our curses doesn't support
that (as per SUS). To quote the SUS (emphasis mine):
The ungetch() function pushes the SINGLE-BYTE character ch onto the
head of the input queue.
and KEY_* values are from 0x100 up, i.e. not single-byte. So later,
when get_arrow_key calls getch() again it receives truncated value
(KEY_* & 0xff) instead of the KEY_* value.
-uwe