Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 345863

Summary: app-misc/screen imposes strange limit on the length of $TERM
Product: Gentoo Linux Reporter: Stelian Ionescu <bugs>
Component: [OLD] UnspecifiedAssignee: Sven Wegener <swegener>
Status: RESOLVED FIXED    
Severity: normal CC: ainsaar, pchrist, shell-tools
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://savannah.gnu.org/bugs/?30880
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Raise the length of d_termnane to NAME_MAX
Patch better suited for upstream, should compile on BSDs too
Fix typo in last patch
Fix hardcoded size of TERM in another place as well

Description Stelian Ionescu 2010-11-17 11:03:25 UTC
In display.h, d_termname is limited to 20 characters(plus the ending NUL) and rxvt-unicode-256color(installed by sys-libs/ncurses) has 21 characters.
Comment 1 Stelian Ionescu 2010-11-17 11:04:09 UTC
Created attachment 254617 [details, diff]
Raise the length of d_termnane to NAME_MAX
Comment 2 Stelian Ionescu 2010-11-17 11:06:48 UTC
Comment on attachment 254617 [details, diff]
Raise the length of d_termnane to NAME_MAX

If strlen(getenv("TERM)) > sizeof(d_termname), screen refuses to start. I've rebuilt screen with that patch and it seems to work
Comment 3 Panagiotis Christopoulos (RETIRED) gentoo-dev 2010-11-17 12:07:27 UTC
Stelian,  thanks for your report. This should go upstream too.
Comment 4 Stelian Ionescu 2010-11-17 12:20:08 UTC
Created attachment 254625 [details, diff]
Patch better suited for upstream, should compile on BSDs too
Comment 5 Stelian Ionescu 2010-11-17 12:21:30 UTC
Created attachment 254627 [details, diff]
Fix typo in last patch
Comment 6 Panagiotis Christopoulos (RETIRED) gentoo-dev 2010-11-17 13:16:34 UTC
Might be similar to:
http://savannah.gnu.org/bugs/?30880
Comment 7 Justin Lecher (RETIRED) gentoo-dev 2010-11-17 14:51:12 UTC
+*screen-4.0.3-r2 (17 Nov 2010)
+
+  17 Nov 2010; Justin Lecher <jlec@gentoo.org>
+  +files/4.0.3-extend-d_termname.patch, screen-4.0.3.ebuild,
+  +screen-4.0.3-r2.ebuild:
+  Fix for long names in TERM, thanks Stelian Ionescu #345863
+
Comment 8 Stelian Ionescu 2010-11-17 16:29:45 UTC
Created attachment 254669 [details, diff]
Fix hardcoded size of TERM in another place as well

As noticed in the Savannah bug, there was another place in the source code where the terminal name was being copied, so I updated that too
Comment 9 Stelian Ionescu 2010-11-17 16:36:25 UTC
Sorry for missing that one
Comment 10 Justin Lecher (RETIRED) gentoo-dev 2010-12-08 18:21:50 UTC
Is this fixed now?
Comment 11 Stelian Ionescu 2010-12-08 21:43:42 UTC
Yes, works here
Comment 12 Justin Lecher (RETIRED) gentoo-dev 2010-12-08 21:45:15 UTC
Thanks closing then.