A few terminal programs provide screen dumps (such as xterm), but most do not (see Existing command line text on screen to file? (non-graphical Linux) for instance). You could make a screenshot using a tool such as gimp, but that will not tell you what the actual characters are. For development, I need to know that.
I'd use script
to record the output into typescript
. You can cat
it back to the screen (or use less -R
, if the escape sequences are simple enough). For more complicated things or long traces, I use other tools:
slowcat
to slow down the cat
progress
vile-pager
to filter the escapes into readable form (better than less
— color sequences work across lines, but still limited to single-line cursor-movement). That's a filter using vi-like-emacs, via a special-purpose utility.
To illustrate the difference, here is a screenshot of less -r
on a typescript
file from running apt-get update
on one of my Debian machines:

In contrast, vile-pager
highlights the places where the text was overwritten:

Either way (less or vile), if your application moves the cursor around the screen, the only way to review the output would be to use cat/slowcat/etc.
mc
orelinks
, or whether it it just prints streaming output to STDOUT and STDERR. – agc Jul 13 '19 at 20:45