Copy terminal scrollback buffer preserving ANSI escape sequences, but without pre-starting script/screen

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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.










share|improve this question



























    up vote
    1
    down vote

    favorite












    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.










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      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.










      share|improve this question















      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.







      gnome-terminal xterm scrolling buffer mate-terminal






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 26 at 23:31

























      asked Aug 26 at 21:50









      adgadg

      355




      355




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          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.






          share|improve this answer




















          • 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 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 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 at 23:14










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464967%2fcopy-terminal-scrollback-buffer-preserving-ansi-escape-sequences-but-without-pr%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          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.






          share|improve this answer




















          • 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 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 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 at 23:14














          up vote
          1
          down vote



          accepted










          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.






          share|improve this answer




















          • 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 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 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 at 23:14












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 26 at 22:14









          Thomas Dickey

          50.2k587157




          50.2k587157











          • 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 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 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 at 23:14
















          • 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 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 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 at 23:14















          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 at 22:54




          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 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 at 23:10




          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 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 at 23:14




          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 at 23:14

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464967%2fcopy-terminal-scrollback-buffer-preserving-ansi-escape-sequences-but-without-pr%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?