I have a live running mate-terminal whose scrollback buffer already contains a lot of text with color/bolding, but (unfortunately) no screen management/capture program (like script/screen/tmux) was started on the terminal. Is it possible to copy the existing scrollback buffer contents to a file, preserving all escape sequences?

There is an answer to this problem for xterm by Thomas Dickey, but even in that solution the color escape sequences are not getting saved to the file specified by the printerCommand resource. but I am looking for a solution for mate-terminal.

Edit note: It seems unlikely that a solution for this problem exists for the mate-terminal; see the comments in Thomas Dickey's answer below.

Just to be clear, pre-starting a terminal screen management/capture program (like script or GNU screen or tmux) is not an option, because here we want to copy terminal output already produced before starting any such program.


You may have overlooked the printAttributes resource:

   printAttributes (class PrintAttributes)
           Specifies whether to print graphic attributes along with the
           text.  A real DEC VTxxx terminal will print the underline,
           highlighting codes but your printer may not handle these.

           o   "0" disables the attributes.

           o   "1" prints the normal set of attributes (bold, underline,
               inverse and blink) as VT100-style control sequences.

           o   "2" prints ANSI color attributes as well.

           The default is "1".

The default resource value makes it compatible with DEC terminals; color is something that you can configure.

  • Yes, that does it for xterm - thanks! (I did overlook the printAttributes resource). Any idea if something similar can be done for mate-terminal? – adgadg Aug 26 '18 at 22:54
  • probably not: mate uses VTE, whose developers haven't expressed an interest in this topic (there are parser stubs with comments saying "probably not worth implementing"). – Thomas Dickey Aug 26 '18 at 23:10
  • Okay, thanks. I am giving up hope and accepting your answer as the solution. I will put an edit in the main question mentioning this point. – adgadg Aug 26 '18 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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