- Subject: slcurses wgetch() behavior
- From: Glenn Maynard <g_slang@xxxxxxxx>
- Date: Wed, 10 Oct 2001 21:15:03 -0400
(My impatience with broken mailing list software may have spilled onto
the list; sorry. :)
I don't know if any of this has come up recently; I wasn't able to find
archives of this list anywhere.
First:
ncurses getch() appears to return unknown escape sequences by not
touching them. Mutt uses this to bind to arbitrary sequences, like
meta keys.
slcurses getch() appears to eat unknwon escape sequences, returning ERR.
This breaks a lot of keys in mutt when compiled with slang. I'd
recommend emulating the ncurses behavior when going through the ncurses
interface.
I doubt this is hard to implement--if in ncurses mode, and an
unrecognized key sequence is found, stuff the remaining characters back
in and return \[.
Second:
$TERMCAP overrides terminfo. I'd suggest checking terminfo first, and
falling back on $TERMCAP. It's obsolete (when used as a termcap string,
at least); ncurses doesn't support that anymore and it causes
inconsistent behavior. Anything that actually needs it on a terminfo
system won't work for most apps, anyway, since that variable is rarely
honored; the only systems I could see it having a use on is ones without
terminfo, and I'm not even certain about that.
Third:
How are meta keys handled (when using slang directly)? A quick grep shows:
sltermin.c: {"mm", 102 UNTIC_COMMENT("turn on meta mode (8th-bit on)")},
sltermin.c: {"mo", 101 UNTIC_COMMENT("turn off meta mode")},
sltermin.c: {"MT", 40 UNTIC_COMMENT("has meta key")},
sltermin.c: {"km", 8 UNTIC_COMMENT("Has a meta key, sets msb high")},
Setting the high bit for meta keys won't work for UTF-8. Is the far more
common practice of prepending ^[ supported at all? (This is unrelated to
slcurses, of course; meta keys in ncurses-compatibility should just return
"^[x" in two getch calls.)
--
Glenn Maynard
[2001 date index]
[2001 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]