<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>1086</bug_id>
          
          <creation_ts>2002-07-13 19:12:13 +0400</creation_ts>
          <short_desc>xterm-like terminals with special names are not detected</short_desc>
          <delta_ts>2003-08-25 15:18:32 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>libgpm</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="imz">vanyaz</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1035</commentid>
    <comment_count>0</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-13 19:12:13 +0400</bug_when>
    <thetext>I mean those, which set TERM=Eterm or TERM=rxvt or smth else.

libgpm doesn\&apos;t detect that these terms are xterm-like, and so doen\&apos;t work the way it should. (In Eterm, Midnight Commander doesn\&apos;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\&apos;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(\&amp;quot;TERM\&amp;quot;)) &amp;amp;&amp;amp; !strncmp(term,\&amp;quot;xterm\&amp;quot;,5)) {


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3866</commentid>
    <comment_count>1</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-17 18:20:54 +0400</bug_when>
    <thetext>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.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7231</commentid>
    <comment_count>2</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-17 18:20:54 +0400</bug_when>
    <thetext>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.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3867</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-07-19 14:01:56 +0400</bug_when>
    <thetext>Fixed in libgpm-1.20.1-alt0.3rc1 (using libtinfo),
but libgpm remains dirty.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7232</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-07-19 14:01:56 +0400</bug_when>
    <thetext>Fixed in libgpm-1.20.1-alt0.3rc1 (using libtinfo),
but libgpm remains dirty.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3868</commentid>
    <comment_count>5</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-20 06:47:02 +0400</bug_when>
    <thetext>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\&apos;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\&apos;s an error! possibly I die! 


And mouse still doesn\&apos;t work in mc in Eterm: start mc, try to press on a menu, it doesn\&apos;t react. in \&apos;TERM=xterm mc\&apos; mouse works (in Eterm).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7233</commentid>
    <comment_count>6</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-20 06:47:02 +0400</bug_when>
    <thetext>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\&apos;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\&apos;s an error! possibly I die! 


And mouse still doesn\&apos;t work in mc in Eterm: start mc, try to press on a menu, it doesn\&apos;t react. in \&apos;TERM=xterm mc\&apos; mouse works (in Eterm).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3869</commentid>
    <comment_count>7</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-10-26 17:45:54 +0400</bug_when>
    <thetext>Apparently, the bug remains unfixed.
Can be reproduced via
$ TERM=Eterm links 2&amp;gt;~/tmp/log
command.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7234</commentid>
    <comment_count>8</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-10-26 17:45:54 +0400</bug_when>
    <thetext>Apparently, the bug remains unfixed.
Can be reproduced via
$ TERM=Eterm links 2&amp;gt;~/tmp/log
command.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3870</commentid>
    <comment_count>9</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-10-26 17:53:05 +0400</bug_when>
    <thetext>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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7235</commentid>
    <comment_count>10</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-10-26 17:53:05 +0400</bug_when>
    <thetext>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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3871</commentid>
    <comment_count>11</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-10-27 20:36:55 +0300</bug_when>
    <thetext>Yes, links works in Eterm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7236</commentid>
    <comment_count>12</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-10-27 20:36:55 +0300</bug_when>
    <thetext>Yes, links works in Eterm.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>96</attachid>
            <date>2002-07-17 18:20:39 +0400</date>
            <delta_ts>2002-07-17 18:20:39 +0400</delta_ts>
            <desc>0001086-gpm-cvs-xterms-with-other-names-hack.patch</desc>
            <filename>0001086-gpm-cvs-xterms-with-other-names-hack.patch</filename>
            <type>application/octet-stream</type>
            <size>0</size>
            <attacher name="imz">vanyaz</attacher>
            
              <data encoding="base64"></data>

          </attachment>
      

    </bug>

</bugzilla>