Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 61195 - scrolling does not work in gnome-terminal if it is running screen, TERM=linux fixes
Summary: scrolling does not work in gnome-terminal if it is running screen, TERM=linux...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-21 13:21 UTC by Daniel Hamm
Modified: 2009-04-22 20:41 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
screenrc-with-gnome.patch (screenrc-with-gnome.patch,2.33 KB, patch)
2006-09-17 00:16 UTC, Alexander Skwar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Hamm 2004-08-21 13:21:32 UTC
When running terminal programs using GNU screen in gnome-terminal the scroll bar and mouse scroll does not work.  I am using a default /etc/screenrc.  I am able to circumvent this bug by setting TERM=linux.  The default is TERM=xterm but it also fails with TERM=rxvt.  multi-gnome-terminal has this same bug however xterm (the terminal not the environment setting) works fine and so does the console

Reproducible: Always
Steps to Reproduce:
1.gnome-terminal
2.screen
3.bitchx

Actual Results:  
the scroll bar does not show that the history buffer is growing and i cannot
scroll up

Expected Results:  
the scroll bar should have gotten bigger and i should have been able to scroll

I suspect this is a problem with gnome-terminal's handling of the xterm protocol
though it could be a setting in the screenrc.  I know nothing about xterm so i
cannot help there but I have tried looking through the termcap and termcapinfo
settings in /etc/screenrc however it is too cryptic for me to be able to find
the cause there
Comment 1 Daniel Hamm 2004-08-21 13:42:15 UTC
changing TERM also makes it so the terminal does not blank to an unuseable blue when a tab is opened.  To cause this to happen you open a gnome-terminal then you run screen then you open a tab then you let both accumulate a few lines using the yes command.  Using TERM=linux fixes this too.  My guess is that the screen goes blue because of an error in not being able to scroll.
Comment 2 Ed Catmur 2004-12-30 17:01:33 UTC
Probably: http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html#TERM

> Q:	My xterm scrollbar does not work with screen.
> A:	The problem is that xterm will not allow scrolling if the alternate text 
> buffer is selected. The standard definitions of the termcap initialize 
> capabilities ti and te switch to and from the alternate text buffer. (The 
> scrollbar also does not work when you start e.g. 'vi'). You can tell screen 
> not to use these initialisations by adding the line
>    termcapinfo xterm ti@:te@
> to your ~/.screenrc file.

I can confirm that this works; either in ~/.screenrc or in /etc/screenrc. Could the reporter please confirm this?

http://lists.gnu.org/archive/html/screen-users/2003-04/msg00009.html implies that Debian and Red Hat add the above line to /etc/screenrc. If this is the correct fix then it would be worth considering adding it to our /etc/screenrc; if so this bug should be passed to the screen maintainers.
Comment 3 Daniel Hamm 2004-12-30 17:11:43 UTC
confirmed.  the suggested configuration provides the desired behavior
Comment 4 Ed Catmur 2004-12-30 17:24:18 UTC
Oh, that's added _commented out_: Debian (screen-3.9.11-5woody1) has:

# Do not use xterms alternate window buffer (won't add lines to scrollback bfr)
#termcapinfo xterm|xterms|xs ti=\E7\E[?47l

Fedora (screen-4.0.2-5) has:

#
# Do not use xterms alternate window buffer. 
# This one would not add lines to the scrollback buffer.
#termcap xterm|xterms|xs ti=\E7\E[?47l
#terminfo xterm|xterms|xs ti=\E7\E[?47l

Perhaps putting a commented out entry into /etc/screenrc would be the correct response? The FAQ link above seems to indicate that screen's behaviour is a misfeature (which, admittedly, interferes with the far-easier-to-use xterm scrollback buffer), not a bug as such.
Comment 5 Daniel Hamm 2004-12-30 17:28:51 UTC
Considering that i looked through the screenrc for such a commented out setting, especially in the exterm features section i think that would be wise.  I've gotten accustomed to doing so because gentoo is so good about it.
Comment 6 Sven Wegener gentoo-dev 2004-12-30 18:26:39 UTC
Our default screenrc has a lot of xterm tweaks. I added the termcapinfo line to
our screenrc. It's enabled by default as all the other tweaks.
Comment 7 SpanKY gentoo-dev 2005-05-14 10:05:42 UTC
isnt this a bug in gnome-terminal and not screen ?

gnome-terminal doesnt actually support 'xterm', it just lies about the whole thing ... if you export TERM=gnome inside of gnome-terminal and you remove this setting from your screenrc, does it work fine ?
Comment 8 Ed Catmur 2005-05-14 10:59:46 UTC
No, that doesn't work.

I think gnome-terminal is doing the right thing here; it's just that screen is stuck in the '70s and assumes it needs to implement its own scrollback buffer in preference to the far easier-to-use scrollback buffer in all modern terminals and terminal emulators.
Comment 9 Alexander Skwar 2006-09-17 00:16:16 UTC
Created attachment 97203 [details, diff]
screenrc-with-gnome.patch

Please reopen this bug!

This bug has now surfaced again with Gnome Terminal 2.14.2.

I suppose, that's because in Gnome Terminal, TERM is set to gnome.

When I start "screen", I cannot scroll back. But when I start "TERM=xterm screen", I can scroll back.

The attached patch should be applied against /etc/screenrc. What it does, is that in the termcap (et.al.) sections for xterm, it adds "gnome|", so that gnome also is good.
Comment 10 Zdenek Behan 2009-04-22 20:41:08 UTC
I just want to note that screen-9999-r1 breaks scrollback buffer in kde konsole. (and is unmasked in ~x86!) Not sure what it was trying to fix or how, but this is broken recently, because the same thing works in screen-4.0.3, with a configuration identical besides screenrc.

Before, I could shift+pgup/pgdn, now i can't. I looked at the diff between configuration files for a long time and couldn't figure out which option breaks this.

I'm simply masking it and going back to 4.0.3, hoping those changes don't make it to 4.0.3-r1. :P