Bug 1086 - xterm-like terminals with special names are not detected
Summary: xterm-like terminals with special names are not detected
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: libgpm (show other bugs)
Version: unstable
Hardware: all Linux
: P4 major
Assignee: placeholder@altlinux.org
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-13 19:12 MSD by imz
Modified: 2003-08-25 15:18 MSD (History)
3 users (show)

See Also:


Attachments
0001086-gpm-cvs-xterms-with-other-names-hack.patch (deleted)
2002-07-17 18:20 MSD, imz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description imz 2002-07-13 19:12:13 MSD
I mean those, which set TERM=Eterm or TERM=rxvt or smth else.

libgpm doesn\'t detect that these terms are xterm-like, and so doen\'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.

---
Run mc in an Eterm. Press Ctrl-O several times, you will see the garbage.

---
libgpm-1.20.1-alt0.1rc1

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)) {


Comment 1 imz 2002-07-17 18:20:54 MSD
Here is a patch to fix it -- as dirty as the original code. ldv has an idea and a code sample on how to do it the other way, but in another place.
Comment 2 imz 2002-07-17 18:20:54 MSD
Here is a patch to fix it -- as dirty as the original code. ldv has an idea and a code sample on how to do it the other way, but in another place.
Comment 3 Dmitry V. Levin 2002-07-19 14:01:56 MSD
Fixed in libgpm-1.20.1-alt0.3rc1 (using libtinfo),
but libgpm remains dirty.
Comment 4 Dmitry V. Levin 2002-07-19 14:01:56 MSD
Fixed in libgpm-1.20.1-alt0.3rc1 (using libtinfo),
but libgpm remains dirty.
Comment 5 imz 2002-07-20 06:47:02 MSD
altair: rpm -q libgpm mc      
libgpm-1.20.1-alt0.3rc1
mc-4.5.99a-alt2

It is much better now: pressing Ctrl-O multiple times in mc in Eterm doesn\'t make a lot of garbage appear on the screen. Now it appears only once on startup:

$ mc
*** err [liblow.c(286)]:
                        strncmp/isdigit/consolename failed
                                                          *** err [liblow.c(395)]:
                                                                                  Oh, oh, it\'s an error! possibly I die! 


And mouse still doesn\'t work in mc in Eterm: start mc, try to press on a menu, it doesn\'t react. in \'TERM=xterm mc\' mouse works (in Eterm).
Comment 6 imz 2002-07-20 06:47:02 MSD
altair: rpm -q libgpm mc      
libgpm-1.20.1-alt0.3rc1
mc-4.5.99a-alt2

It is much better now: pressing Ctrl-O multiple times in mc in Eterm doesn\'t make a lot of garbage appear on the screen. Now it appears only once on startup:

$ mc
*** err [liblow.c(286)]:
                        strncmp/isdigit/consolename failed
                                                          *** err [liblow.c(395)]:
                                                                                  Oh, oh, it\'s an error! possibly I die! 


And mouse still doesn\'t work in mc in Eterm: start mc, try to press on a menu, it doesn\'t react. in \'TERM=xterm mc\' mouse works (in Eterm).
Comment 7 Dmitry V. Levin 2002-10-26 17:45:54 MSD
Apparently, the bug remains unfixed.
Can be reproduced via
$ TERM=Eterm links 2>~/tmp/log
command.
Comment 8 Dmitry V. Levin 2002-10-26 17:45:54 MSD
Apparently, the bug remains unfixed.
Can be reproduced via
$ TERM=Eterm links 2>~/tmp/log
command.
Comment 9 Dmitry V. Levin 2002-10-26 17:53:05 MSD
Really fixed in libgpm-1.20.1-alt0.5rc1.
All libgpm users (except mc) should work as expected in Eterm.
Unfortunately, mc crashes now (#0001473).
Comment 10 Dmitry V. Levin 2002-10-26 17:53:05 MSD
Really fixed in libgpm-1.20.1-alt0.5rc1.
All libgpm users (except mc) should work as expected in Eterm.
Unfortunately, mc crashes now (#0001473).
Comment 11 imz 2002-10-27 20:36:55 MSK
Yes, links works in Eterm.
Comment 12 imz 2002-10-27 20:36:55 MSK
Yes, links works in Eterm.