Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When I use screen inside a putty session, I can't seem to use the scrollback buffer of putty to look at whatever just scrolled off the screen. Instead, I just see what was happening in the putty session just prior to my running screen.

What am I missing here? I like being able to scroll back, and I don't want to use the screen functionality to look at the past buffer; the scroll wheel on my mouse doesn't have hooks into screen and I don't expect it ever would.

Thanks!

share|improve this question

closed as off topic by sysadmin1138 Jul 10 '11 at 23:43

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
LOL: "closed" but more than 20 up votes for question and answer and more than 10 stars. This sysadmin1138 really knows what is needed by sys admins. –  ceving Oct 5 at 10:56

4 Answers 4

up vote 24 down vote accepted

You might also check out the Screen FAQ which allows a sort of hybrid behavior:

Summary: add the line to your .screenrc file:

termcapinfo xterm ti@:te@

Reference ( Putty FAQ )

PuTTY's terminal emulator has always had the policy that when the ‘alternate screen’ is in use, nothing is added to the scrollback. This is because the usual sorts of programs which use the alternate screen are things like text editors, which tend to scroll back and forth in the same document a lot; so (a) they would fill up the scrollback with a large amount of unhelpfully disordered text, and (b) they contain their own method for the user to scroll back to the bit they were interested in. We have generally found this policy to do the Right Thing in almost all situations.

Unfortunately, screen is one exception: it uses the alternate screen, but it's still usually helpful to have PuTTY's scrollback continue working. The simplest solution is to go to the Features control panel and tick ‘Disable switching to alternate terminal screen’. (See section 4.6.4 for more details.) Alternatively, you can tell screen itself not to use the alternate screen: the screen FAQ suggests adding the line ‘termcapinfo xterm ti@:te@’ to your .screenrc file.

share|improve this answer
    
A much better set of solutions. –  Zanchey Aug 4 '09 at 15:33

To scroll back, press ^A (Ctrl-A, or whatever your screen control sequence is if you remapped it) and then Esc. This will let you move the cursor up and down. PgUp/PgDn will let you scroll up and down inside of screen.

The reason for this is the way that screen handles the scrollback buffer. Screen always draws the full text area, and has its own backbuffer that you must control with screen. This is similar to using programs, like vi or joe, that take up the entire text area and provide their own buffer: scrolling up in your terminal emulator just gives garbage, but scrolling up inside those programs gives your intended result.

share|improve this answer
    
So the only way I'd be able to use the scroll wheel on my mouse (okay, I am that lazy!) is if I remap it to somehow send [screen escape key] then ESC then up and down? Ugh, that's too much work... –  chris Jun 26 '09 at 17:18
    
@chris: If you're using putty, you should already have your hands on the keyboard. If you have a laptop, try seeing if you can remap some keys you don't use as frequently to PgUp/PgDn. –  Andrew Scagnelli Jun 26 '09 at 17:54
    
many times you're looking at a long command output in putty, and it's more convenient to scroll back and forth with the wheel than with the keyboard. –  Elazar Leibovich May 8 '11 at 9:07

That's because of how screen works. Screen does a dynamic update of your whole text area, rather than pushing new lines at the bottom of the screen which in turn pushes the top line into the scroll-back area. It redraws the whole screen when a new line shows up, which prevents more data going into scroll-back. The same problem exists in 'less' when not using screen.

share|improve this answer
    
I can't say I'd ever noticed with less, but that's probably because I'm always inside screen to begin with. Thanks for the specifics of the hows and whys! –  chris Jun 26 '09 at 17:20

Screen with Putty scrollback is working automatically in Solaris 10. It seems to be doing what KnipSter said by default even though I do not have a .screenrc file. The problem with this approach is that, if you detach and re-attach then there is no scrollback buffer in Putty and you must resort to using Screen's scrollback as described by Scagnelli.

share|improve this answer
    
Screen comes with solaris 10 these days? Is it a sun massaged version or is it whatever you get from gnu? This is really interesting that it works this way in this specific case. Thanks for the info! –  chris Aug 26 '09 at 19:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.