[gpm]BUG: xterm-like terminals with special names are not detected

Ivan Zakharyaschev imz@altlinux.ru
Sat, 13 Jul 2002 19:22:10 +0400 (MSD)


	Hello!

I'm using the latest libgpm-1.20.1-alt0.1rc1 (an 1.20.1rc1 build).

libgpm doesn't detect that the terminals which set TERM=Eterm or
TERM=rxvt or smth else are xterm-like, and hence doesn't work the way it
should. (In Eterm, Midnight Commander doesn't react upon mouse button
press on a menu.) libgpm in these cases even reports some error which
spoils MC screen:

*** debug [liblow.c(202)]:
VC: 0
*** err [liblow.c(261)]:
strncmp/isdigit/consolename failed
*** err [liblow.c(370)]:
Oh, oh, it's an error! possibly I die!


If MC is started like this:

TERM=xterm mc

it works well, no error messages appear.

Steps To Reproduce:

Run mc in an Eterm (which will set TERM=Eterm).  Press Ctrl-O several
times, you will see the garbage. Try to open a menu by a button press,
it won't open.

Additional Information:

The bug is not suprising: if we look in liblow.c from gpm, we see that
checking for xterm is done as follows:

if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) {

There is no place for Eterm. I'm not sure that simply adding a check for
"Eterm" would be The Right Thing, since one can call a terminfo entry
whatever he wants. Perhaps, gpm can make the decision whether the
terminal is xterm-like based on some terminfo capability...

Best regards,
-- 
Ivan Zakharyaschev
ALT Linux Team member, Sisyphus developer
http://www.altlinux.ru