[TriLUG] Capture Terminal Session without Control or Color Codes

Stephen P. Schaefer via TriLUG trilug at trilug.org
Fri Dec 2 03:43:57 EST 2022


Try
export TERM=DUMB
...after the ssh.  The dumb terminal doesn't have any escape codes; vi will be ugly and barely functional.  less or more will be ugly but meh.

This is why I can still remember six ed commands :-)


On Thu, Dec 1, 2022, at 7:40 PM, Alan Sterger via TriLUG wrote:
> Yeah so far ttyrec, script and screen output files all contain escape 
> sequences.  "Gold" output test is 'less'.  Output has so many escape 
> sequences, less tells me its a binary file and do I still want to view it!
>
> Any thing else?
>
> -- Alan Sterger
>
> On 12/1/2022 5:24 PM, Aaron Morrison wrote:
>> Look into ttyrec/ttyplay and script/scriptreplay commands. It’s been a decade or so since I’ve done this, but it should be possible. There should be options for recording the timings of the commands, etc. if needed as well.
>>
>> What I don’t remember off hand is how well they would filter escape sequences for you.
>>
>> --am
>>
>>
>>> On Dec 1, 2022, at 14:05, Alan Sterger via TriLUG <trilug at trilug.org> wrote:
>>>
>>> Hi all,
>>>
>>> Need to capture both sides of an ssh session for documentation including all in-session commands (like vi that redraws the screen).  Last time I did this used something like
>>>
>>> ssh user at server |tee /path/to/ssh/logfile.log However, received a lot of non-printable characters like Control and Color codes. Then spent a couple of hours running session output through various text filters. Local terminal is Ubuntu 20.04; ssh'ing to RHEL 7 if it matters. Any suggestions? -- Alan Sterger
>>>
>>> -- 
>>> This message was sent to: Aaron Morrison <ae4ko1 at gmail.com>
>>> To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
>>> TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
>>> Unsubscribe or edit options on the web    : https://www.trilug.org/mailman/options/trilug/ae4ko1%40gmail.com
>>> Welcome to TriLUG: https://trilug.org/welcome
>
> -- 
> This message was sent to: sschaefer at acm.org <sschaefer at acm.org>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from 
> that address.
> TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web	: 
> https://www.trilug.org/mailman/options/trilug/sschaefer%40acm.org
> Welcome to TriLUG: https://trilug.org/welcome


More information about the TriLUG mailing list