capturing terminal scrollback buffer? 

Newsgroups:  gmane.linux.debian.user
Date:        Sat, 30 Sep 2006 12:30:09 -0400
> anybody know how to capture the contents of a terminal scrollback
> buffer? i've got about 1000 lines of debug stuff from a network
> problem that I want to save, but its just sitting in the scroll back
> buffer of an aterm. argh! how do I get it out of there without
> copy/pasting it one screen at a time?

Here's how I do it on aterm:

Drag scrollbar up (back) to first desired line. Start selecting a few characters of text (left mouse button, drag…). Let go of mouse button. Drag scrollbar down to end of desired line. Right click. Let go of mouse button. All desired text is selected. Now you can paste it where you like…

$ cat > textbuffer

Middle-click to paste, etc.

Much easier to do than to describe.

Ralph Katz

capturing terminal scrollback buffer? 

> buffer of an aterm. argh! how do I get it out of there without
> copy/pasting it one screen at a time?

For the future, you may want to take a look at gnu/screen.

When you are running your terminal sessions under gnu/screen and you suddenly realize that you need to take a screen dump on the fly, all you need to do is:

  • issue the gnu/screen escape keyboard action (Ctrl-A by default)
  • :hardcopy -h dumpfile

The -h flag causes gnu/screen to write the contents of the current display as well as the contents of the scrollback buffer to the specified file.

The point is that it's always there ready for you to use .. you don't need to do anything special prior to starting your debugging session & whatnot.

Needless to say that there a tons of other great features in gnu/screen such as advanced copying & pasting between terminal sessions and activating/deactivating session logging on the fly .. among many others.

For a terse introduction to gnu/screen's capabilities you could read the following article :

http://jmcpherson.org/screen.html

For an in-depth description of gnu/screen's many talents I'm afraid that there is no advanced tutorial that I am aware of and you will have to study the excellent but somewhat unfriendly manual (man screen).

cga2000