views:

1184

answers:

3

Hi,

I use the screen command for command-line multitasking in Linux and I set my scrollback buffer length to a very large value. Is there a key combination to clear the buffer for a certain tab when I don't want it sitting there anymore?

Thanks.

+1  A: 
  • C-a C will clear the screen, including the prompt
  • clear (command, not key combination) will clear the screen, leaving a prompt

ETA: misread the original question; these will just clear the visible text, but will not clear the buffer!

Athena
None of those clear the scrollback buffer though; and the second one creates a new screen window, leaving the previous one still there (press `C-a a` to get back to it).
Greg Hewgill
I misread the original question, and made a mistake with the second -- thought I could clear that out before spreading the misinformation, but I underestimated how fast people are here :-)(FTR, my original comment had `C-a c` as another solution)
Athena
A: 

From the man page:

C-a C       (clear)       Clear the screen.
may be you missed what the question asked in the first place...
Aman Jain
simple enough misunderstanding, but do read the questions for details
Fire Crow
+8  A: 

Next time try Google as well, as they are the programmer's best friend. Search keywords: gnu screen delete scrollback buffer.

For me, this thread was the second hit.

In the window whose scrollback you want to dele

te, set the scrollback to zero, then return it to its normal value (in your case, 15000).

If you want, you can bind this to a key:

bind / eval "scrollback 0" "scrollback 15000"

You can issue the scrollback 0 command from the session as well, after typing C-a :. HTH.

Zsolt Botykai
Excellent, I didn't know you could change it on the fly!
Greg Hewgill
Woo - couldn't find this one! good answer!
Mez
Google aside, the purpose of Stack Overflow is to be the place for canonical answers, so I for one am fine with things being duplicated in a place where I know they can be found.
Drew Stephens
That's why I had wuoted the solution as well. And we could argue about google but with those simple keywords it was the very first hit for me. And actually I had read that message on the mailing list when it was posted, that's why I had remembered.
Zsolt Botykai