On Mon, Aug 07, 2000 at 10:09:29PM +0200, Jesper Holmberg wrote:
> Well this is exactly what I've experienced as well. On RedHat 6.1,
> <end> didn't work. After an upgrade to RedHat 6.2, the problem
> disappeared. Now, on Mandrake 7.1, as my previous question indicated,
> neither <home>, <end>, ALT nor F1-F12 work.
>
> Could anyone explain this? These three systems are indeed rather
> similar.
OK, you asked for it...
<rant>
Various terminal control sequences, including the ones that the terminal
sends to the program on various key presses, are described in the
terminfo database (distributed with ncurses). The program knows what
type of terminal you have by checking the $TERM variable.
This is a nice and clever system. Unfortunatelly, very often the
database and the actual terminal control sequences get out of sync.
This is due to the sad fact, that different versions of a terminal
program and even different kinds of them often advertise themselves with
the same $TERM value ("xterm" is the most popular), but send and
interpret quite different control sequences. Besides, even the same
version of the same program can be compiled with different #defines and
have various configuration files that change the control sequences, but
terminfo description stays the same.
The result is a mess. I've yet to see a single Linux distribution which
doesn't need terminfo hacking for all keys to be recognised correctly in
all terminal emulators (things usually work fine in the Linux console...
except the notorious Backspace/Delete issue). I admit that I haven't
seen much of them (only different versions of Slackware, Red Hat and
Mandrake).
All keys work for me now. This is because I spent weeks configuring
Eterm: hacking its terminfo, playing with configure options and various
#defines, and sending bug reports to the author (which was quick to
respond, thanks, Michael). It took so long mostly because I was doing
it by trial and error, and had to learn about this terminfo thing and
how it works. I think I could fix a broken[1] terminfo entry in a
couple of minutes now:
$ infocmp $TERM > $TERM.ti
$ vi $TERM.ti
(with a couple of shells to do `man terminfo')
$ tic $TERM.ti
---
[1] It's hard to say which is broken -- the terminfo entry, or the
terminal program, which doesn't correctly emulate the terminal described
in terminfo. But it is easier to change the terminfo entry than the
program.
</rant>
Good luck,
Marius Gedminas
--
If C gives you enough rope to hang yourself, C++ gives you enough rope
to bind and gag your neighborhood, rig the sails on a small ship, and
still have enough rope left over to hang yourself from the yardarm.