Bug 1086

Summary: xterm-like terminals with special names are not detected
Product: Sisyphus Reporter: imz <vanyaz>
Component: libgpmAssignee: placeholder <placeholder>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P4 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
0001086-gpm-cvs-xterms-with-other-names-hack.patch none

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(\&quot;TERM\&quot;)) &amp;&amp; !strncmp(term,\&quot;xterm\&quot;,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&gt;~/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&gt;~/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.