bug-ncurses
[Top][All Lists]
Advanced

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

Re: filter() prevents clearing of screen, but still clears current line


From: Avery Pennarun
Subject: Re: filter() prevents clearing of screen, but still clears current line
Date: Mon, 19 Mar 2007 12:51:50 -0400

On 19/03/07, Thomas Dickey <address@hidden> wrote:
On Mon, 19 Mar 2007, Avery Pennarun wrote:
> define_key() has the very unfortunate property that it's
> per-application, not included in terminfo.  So you'd have to patch
> every single application to make it properly recognize, say, all the
> different variants of K_HOME.  This is contrary to the purpose of
> terminfo in the first place.

hmm - no.  Anyone can write an add-on library and use that instead
of the terminfo interface.

Well, of course you could write an add-on library and have people use
that, but I mean that you'd still have to modify every application
away from ncurses/terminfo and have them use the new library.  It
would be better if ncurses/terminfo could support this behaviour
themselves, then all applications that used them would inherit the
features automatically.

There's very little magic to the library I wrote.  The key handling
simply allows a many-to-one mapping of escape sequences to keycodes
(ie. more than one escape sequence that means "Home" or "End" or
"Delete").  The ncurses implementation already supports this, as you
point out, using things like define_key(), and it uses a tree to look
up input escape sequences and map them to key codes, and nothing
prevents that tree from having more than one sequence map to the same
keycode.

It's just the terminfo database itself that gets in the way, which is
unfortunate, because I'd like to put the list of *all* possible escape
sequences for, say, KHOME, in a single entry.

(We actually had this discussion briefly before:
http://lists.gnu.org/archive/html/bug-ncurses/2006-08/msg00047.html)

(Showing us the code would help continue the discussion).

I'd like to, but unfortunately it was written for my employer at the
time and I no longer work there.  I'd be happy to tell you about how
it works, though.  There's nothing special to it.

Have fun,

Avery




reply via email to

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