Screen missing terminfo entries for 'xterm'

Bug #190852 reported by Matt Reynolds
6
Affects Status Importance Assigned to Milestone
ncurses (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Binary package hint: screen

Popping around on the internet, I discovered that there is a pretty well known problem, namely backspace not working correctly in many cases (wuff wuff!). The standard solution has been some form of TERM hackery, doing something like aliasing:
TERM=screen screen

for the screen command. This seems to work be simply defeating the term lookup on most systems, so that screen loads the terminfo for 'screen' only. The description of how screen finds it's terminfo is here ( http://www.delorie.com/gnu/docs/screen/screen_102.html ), so I went to go look for why screen works on my Mac, but not my Ubuntu box. Well, I can't tell you why it works on my Mac, but I was able to get screen working properly by setting a TERM besides 'screen'. It seems to be looking for files in /usr/share/terminfo, and if it finds one, it works. Otherwise, from the docs:

When screen tries to figure out a terminal name for itself, it first looks for an entry named screen.term, where term is the contents of your $TERM variable. If no such entry exists, screen tries `screen' (or `screen-w', if the terminal is wide (132 cols or more)). If even this entry cannot be found, `vt100' is used as a substitute.

Maybe this is a terminfo bug?

Revision history for this message
Matt Reynolds (mreynolds) wrote :
Download full text (4.1 KiB)

Well, I found some more information. I thought I might be able to fix the problem by fixing the term, but I don't think that's involved. Here's what I did.

I symlinked the "screen" terminfo files to /usr/share/terminfo/screen.xterm and screen.xterm-color, to no avail. Also tried /lib/terminfo and even symlinking them into /etc/terminfo. None of these options worked with a TERM of xterm-color. So, I tried using the -T option on screen to manually set the term to 'screen.xterm' or 'xterm' (instead of TERM=xterm, for example) and that didn't work either.

My terminfo folders look like this:
find /lib/terminfo/ /usr/share/terminfo/ | grep screen
/lib/terminfo/s/screen
/lib/terminfo/s/screen-bce
/lib/terminfo/s/screen-s
/lib/terminfo/s/screen-w
/lib/terminfo/s/screen.xterm-color
/usr/share/terminfo/s/screen
/usr/share/terminfo/s/screen-256color-s
/usr/share/terminfo/s/screen-bce
/usr/share/terminfo/s/screen.teraterm
/usr/share/terminfo/s/screen-256color-bce
/usr/share/terminfo/s/screen-16color
/usr/share/terminfo/s/screen.xterm-new
/usr/share/terminfo/s/screen-s
/usr/share/terminfo/s/screen-16color-bce
/usr/share/terminfo/s/screen-w
/usr/share/terminfo/s/screen.xterm-xfree86
/usr/share/terminfo/s/screen.xterm
/usr/share/terminfo/s/screen2
/usr/share/terminfo/s/screen-16color-bce-s
/usr/share/terminfo/s/screen.linux
/usr/share/terminfo/s/screen.xterm-r6
/usr/share/terminfo/s/screen-256color
/usr/share/terminfo/s/screen-256color-bce-s
/usr/share/terminfo/s/screen3
/usr/share/terminfo/s/screen-16color-s
/usr/share/terminfo/s/screen.xterm-color

I added a few symlinks as tests.

Currently, it seems like this is a terminfo issue, but I can't fix it using any of the things I know about terminfo.

Here's the working (TERM=xterm) dumped terminfo file:
SC|screen.xterm|VT 100/ANSI X3.64 virtual terminal:\
 :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
 :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\
 :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\
 :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\
 :li#66:co#275:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:\
 :cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:dc=\E[P:DC=\E[%dP:\
 :im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:\
 :ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
 :ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:\
 :se=\E[23m:mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:ms:\
 :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
 :vb=\Eg:G0:as=\E(0:ae=\E(B:\
 :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\
 :po=\E[5i:pf=\E[4i:k0=\E[10~:k1=\EOP:k2=\EOQ:k3=\EOR:\
 :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
 :k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:F3=\EO2P:\
 :F4=\EO2Q:F5=\EO2R:F6=\EO2S:F7=\E[15;2~:F8=\E[17;2~:\
 :F9=\E[18;2~:FA=\E[19;2~:kb=:K2=\EOE:kB=\E[Z:\
 :*4=\E[3;2~:*7=\E[1;2F:#2=\E[1;2H:#3=\E[2;2~:#4=\E[1;2D:\
 :%c=\E[6;2~:%e=\E[5;2~:%i=\E[1;2C:kh=\E[1~:@1=\E[1~:\
 :kH=\E[4~:@7=\E[4~:kN=\E[6~:kP=\E[5~:kI=\E[2~:kD=\E[3~:\
 :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:km:

Here's the non-working version :
SC|screen.xterm-color|VT 100/ANSI X3.64 virtual terminal:\
 :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
 :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH...

Read more...

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 or 9.04?

Changed in screen:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Micah Cowan (micahcowan) wrote :

Reassigning to ncurses from screen, as proper terminfo description files is that package's responsibility, and not screen's (except things like /usr/share/terminfo/s/screen, but I don't know that those other screen ones are part of the screen package proper).

The offending bit is probably "kb=^H"; many folks prefer that "kb=^?", though which is appropriate may depend on the user's configuration. Best may be to ensure they're undefined ("kb=", or no kb definition) so that applications instead use whatever stty (termios) says to use.

Note that "kb" is a termcap name; in the real terminfo files it'd appear as "kbs".

My setup on Intrepid has "kb=\177" for xterm, so possibly this has been fixed? I don't know what the original user had for xterm, though, as only "screen.xterm" and such are shown (I don't have those). So I'm leaving as "incomplete".

Note that tricks like "TERM=screen screen" are a bad idea. It may fix one problem and cause several other, subtler ones.

Revision history for this message
Victor Vargas (kamus) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in ncurses (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Thomas Dickey (dickey-his) wrote :

Actually, there was adequate information to discuss the report.
(looks like someone's mis-triaging reports).

Revision history for this message
Victor Vargas (kamus) wrote :

@Thomas, please what do you mean with mis-triaging? I closed this report because have a long time here without activity and since nobody has confirmed this problem I change to invalid until other people can check if this issue is still occurring. Please remember some paragraphs of code of conduct my friend.

Best regards

Revision history for this message
Thomas Dickey (dickey-his) wrote : Re: [Bug 190852] Re: Screen missing terminfo entries for 'xterm'

On Wed, 28 Oct 2009, Kamus wrote:

> @Thomas, please what do you mean with mis-triaging? I closed this report
> because have a long time here without activity and since nobody has
> confirmed this problem I change to invalid until other people can check
> if this issue is still occurring. Please remember some paragraphs of
> code of conduct my friend.

There's enough information to see the basic problem.
What's lacking is for the package maintainer to follow the thread,
ask questions if they don't follow it.

The essential problem reported is that Ubuntu's customization to change
kbs (presumably to change it from ^H to \177) did not work for the person
who reported the problem. That can be because the screen entries did not
contain that customization, or due to an error in one of the special
terminfo entries (even a bug in screen ;-).

ncurses's terminfo database contains some special entries which are
interpreted by screen, e.g., these listed by toe:

screen.xterm-xfree86 screen customized for modern xterm
screen.xterm-r6 screen customized for X11R6 xterm
screen.teraterm disable ncv in teraterm
screen.rxvt screen in rxvt
screen.Eterm screen in Eterm
screen.linux screen in linux console
screen.mlterm screen in mlterm

That is, outside 'screen', if $TERM is "mlterm", for instance, it
would use "screen.mlterm". Those entries work around various problems
with screen's matching _exactly_ a given terminal entry.

The followup should have been focused on first verifying what the
terminfo entry inside 'screen' was, and what the special entry shows,
to see if one of those displays the problem. If they're set properly,
then (barring the reporter _wanting_ kbs=^H), then it should have been
reassigned back to screen's maintainer to analyze.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Revision history for this message
Micah Cowan (micahcowan) wrote :

Kamus, I see absolutely nothing in Thomas Dickey's comments that even remotely hint at a violation of the Code of Conduct, so maybe you could consider dialing your sensitivity down a bit?

Thomas, I think the (previous) "Incomplete" status was due to the question as to whether it was still reproducible in recent releases; I don't believe it is (I've never seen any of "screen.xterm", "screen.xterm-color" or any other provided on an Ubuntu system, so wouldn't be able to produce his setup), and the original poster didn't respond in nearly a year, so that's normally grounds for closing the bug as "Invalid".

FWIW, I'm not sure if Ubuntu's "kbs=\177" value counts as a "customization"; that's what screen currently provides in its included terminfo description, and I know Ubuntu(/Debian) include code from relatively recent development versions.

Revision history for this message
Thomas Dickey (dickey-his) wrote :

On Wed, 28 Oct 2009, Micah Cowan wrote:

> Kamus, I see absolutely nothing in Thomas Dickey's comments that even
> remotely hint at a violation of the Code of Conduct, so maybe you could
> consider dialing your sensitivity down a bit?
>
> Thomas, I think the (previous) "Incomplete" status was due to the
> question as to whether it was still reproducible in recent releases; I
> don't believe it is (I've never seen any of "screen.xterm", "screen
> ..xterm-color" or any other provided on an Ubuntu system, so wouldn't be
> able to produce his setup), and the original poster didn't respond in
> nearly a year, so that's normally grounds for closing the bug as
> "Invalid".

I don't have Ubuntu to compare, but my understanding is that it's largely
a copy of Debian/testing. Those entries in Debian/testing would be in the
larger "ncurses-term" package:

/usr/share/terminfo/s/screen.rxvt
/usr/share/terminfo/s/screen.xterm-r6
/usr/share/terminfo/s/screen.mlterm
/usr/share/terminfo/s/screen.xterm-xfree86
/usr/share/terminfo/s/screen.teraterm
/usr/share/terminfo/s/screen.Eterm
/usr/share/terminfo/s/screen.linux
/usr/share/terminfo/s/screen.xterm-new

> FWIW, I'm not sure if Ubuntu's "kbs=\177" value counts as a
> "customization"; that's what screen currently provides in its included
> terminfo description, and I know Ubuntu(/Debian) include code from
> relatively recent development versions.

ncurses's terminfo.src has kbs=^H.

Since (all but a few) terminfo entries come from ncurses in Debian, etc.,
the change is addressed by a packager's patch (customization). In
particular, the Debian package for 'screen' does not install any terminfo
data...

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Revision history for this message
Victor Vargas (kamus) wrote :

@Tomas, Sorry was a misunderstand, my apologies :). I tried to reproduce some steps in Karmic (up-to-date) and I see same files except when install ncurses-xterm package that comes with screen.xterm-new binary.

Best regards

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.