bug-ncurses
[Top][All Lists]
Advanced

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

Re: terminfo, function keys and linux console


From: Tim Allen
Subject: Re: terminfo, function keys and linux console
Date: Fri, 9 Jan 2009 16:26:08 +1100
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Jan 09, 2009 at 05:12:54AM +0000, Dave Wood wrote:
> I notice in /etc/termcap:
>
> :k1=\E[[A:k2=\E[[B:k3=\E[[C:k4=\E[[D:k5=\E[[E:k6=\E[17~:\
>
> for linux console. I tried changing these too but no effect. You mention
> editing source, but what is the point of termcap/terminfo if those entries
> get ignored and the console emits what it likes? I don't understand this at
> all. I thought the whole point of terminfo was that is was to do just that?

Let's say you're running mutt on the linux console and hit F1. Whatt
happens is something like this:

 - The kernel reads the scancode from the keyboard hardware.
 - The kernel figures out which TTY is connected to the active virtual
   console.
 - The console driver converts the keycode into a string, and writes
   that string to the TTY.
 - mutt reads the string from the TTY, then hands the string off to
   ncurses.
 - ncurses looks up the string in the termcap/terminfo database.
 - ncurses finds the string corresponds to KEY_F1 (or whatever) and
   returns that code to mutt.
 - mutt runs whatever function is bound to KEY_F1.

If you change the definition of F1 in the termcap/terminfo databases,
you'll merely prevent applications from recognising the F1 key, you
won't cause the console driver change.

The only terminal emulator I know of that reads termcap/terminfo to
figure out what to send is zvt, used by gnome-terminal - and these days
it has a lot of hard-coded VT100 sequences anyway.




reply via email to

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