Scroll to navigation

TTYREC(1) User Commands TTYREC(1)

NAME

ttyrec - a tty recorder

SYNOPSIS

ttyrec [options] -- <command> [command options]

ttyrec -e <command> [options] [ttyrec file name]

OPTIONS

specify an UUID (can be any string) that will appear in the ttyrec output file names, and kept with SIGUSR1 rotations (default: own PID)
full path of the first ttyrec file to write to (autogenerated if omitted)
folder where to write the ttyrec files (taken from -f if omitted, defaulting to working directory if both -f and -d are omitted)
custom strftime-compatible format string to qualify the full path of the output files, including the SIGUSR1 rotated ones
open the ttyrec output file in append mode instead of write-clobber mode
enable on-the-fly compression if available, silently fallback to no compression if not
force on-the-fly compression of output file using zstd, the resulting file will have a '.ttyrec.zst' extension
specify the maximum number of seconds after which we'll force zstd to flush its output buffers to ensure that even somewhat quiet sessions gets regularly written out to disk, default is 15
set compression level, must be between 1 and 19 for zstd, default is 3
count the number of bytes out and print it on termination (experimental)
lock session on input timeout after S seconds
warn S seconds before locking (see --lock-timeout)
kill session on input timeout after S seconds
warn S seconds before killing (see --kill-timeout)
disable cheat-codes (see below), this is the default
enable cheat-codes (see below)
don't use openpty() even when it's available
MODE can be either 'never' (never allocate a pseudotty, even if stdin is a tty, and use pipes to handle stdout/stderr instead), 'always' (always allocate a pseudotty, even if stdin is not a tty) or 'auto' (default, allocate a pseudotty if stdin is a tty, uses pipes otherwise)
verbose (debug) mode, use twice for more verbosity
show version information
enables legacy compatibility mode and specifies the command to be run under the user's $SHELL -c

EXAMPLES

ttyrec -e 'for i in a b c; do echo $i; done' outfile.ttyrec
ttyrec -f /tmp/normal.ttyrec -- sh -c 'for i in a b c; do echo $i; done'
ttyrec -t 60 -k 300 -- ssh remoteserver
ttyrec -- ssh remoteserver < script.sh
ttyrec screen

FOOTNOTES

Handled signals:

close current ttyrec file and reopen a new one (log rotation)
lock session
unlock session

Cheat-codes (magic keystrokes combinations):

^L^L^L^L^L^L^L^L
lock your session (that's 8 CTRL+L's)
^K^I^L^L^K^I^L^L
kill your session

Remark about session lock and session kill:

If we don't have a tty, we can't lock, so -t will be ignored, whereas -k will be applied without warning, as there's no tty to output a warning to.
June 2019 ttyrec v1.1.5.0