Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2424  / 3 Years ago, wed, may 12, 2021, 7:31:44

VT100 terminals have a relatively simple way to save terminal contents with escape codes to a file using Meta-p:



XTerm.VT100.printAttributes: 2
XTerm.VT100.printerCommand: cat - > file
XTerm.VT100.translations: #override Meta <KeyPress> P: print()



I've looked around quite a bit, and can't find a solution for this to work in the default GNOME Terminal + XTerm + Bash.



I do not want just an image with the contents of the window.



It looks like GNOME Terminal might eventually get a fix for this, but there's no information about which version it will be included in, and it's been almost three years since the last update...


More From » bash

 Answers
3

Unfortunately, l0b0 the answer out of the box is: This is not possible.



In my other answer, I listed how to use script to do this, though there are some differences as you noted. The other way is to compile the source or use an unstable version.



Gnome Terminal Source Tarball



The version in Raring is 3.6.1, so you can look at this source. Inside of Terminal-window.c on line 115:



/*
* We don't want to enable content saving until vte supports it async.
* So we disable this code for stable versions.
*/

#include "terminal-version.h"

#if (TERMINAL_MINOR_VERSION & 1) != 0
#define ENABLE_SAVE
#else
#undef ENABLE_SAVE
#endif
#endif


Options:




  1. Add #define ENABLE_SAVE under this.

  2. Modify the version to an unstable.

  3. Download an unstable version of the .DEB.



Hope this helps.


[#35850] Friday, May 14, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cheeturage

Total Points: 432
Total Questions: 111
Total Answers: 115

Location: Bahrain
Member since Tue, Mar 1, 2022
2 Years ago
;