How to save GNU screen scroll buffer
Posted by hide1713 on February 27, 2011
If you use gnu screen, I am sure this tip will be useful someday. If you ran some programs for hours and want to dump the whole scroll buffer to a file. Here’s how:
Ctrl-a :hardcopy -h dump_file.
Note: the dump_file might have many empty line at the beginning, you might need to scroll down a little bit to see the content.
Do NOT use the Ctrl-a [ copy buffer for super big block, screen might die!
From screen user manual:
18.1 hardcopy
(C-a h, C-a C-h)
Writes out the currently displayed image to the file file, or, if no filename is specified, to hardcopy.n in the default directory, where n is the number of the current window. This either appends or overwrites the file if it exists, as determined by thehardcopy_appendcommand. If the option-his specified, dump also the contents of the scrollback buffer.