scriptlive
Replay interactive terminal sessions
TLDR
Execute a typescript in real-time
Execute a typescript at double the original speed
Execute a typescript created using --log-in option of script
Execute a typescript waiting at most 2 seconds between each command
SYNOPSIS
scriptlive [options] typescript_file
PARAMETERS
typescript_file
The path to the file containing the terminal session recording, typically generated by the script(1) command. This file usually contains the raw text output and potentially embedded timing information.
-d DELAY, --delay=DELAY
Add an artificial delay (in seconds) between characters or lines. This can be used to slow down or speed up the playback relative to the recorded timing, or to introduce a uniform delay if no timing information is available.
-s SPEED, --speed=SPEED
Adjust the playback speed. A value of 1.0 means original recorded speed, 2.0 means twice as fast, 0.5 means half as fast. This modifies the pauses and delays between actions during playback.
-n, --no-timing
Ignore any recorded timing information and play back the terminal session as fast as possible, primarily respecting only line breaks and basic output structure.
-c, --clear
Clear the screen of the current terminal before starting the playback of the recorded session.
-h, --help
Display a help message that shows the command's syntax, options, and provides a brief explanation of its usage, then exit.
DESCRIPTION
The scriptlive command is a utility designed to replay terminal session recordings, typically generated by the script(1) command, in a live, real-time fashion. Unlike simply viewing the raw output file, scriptlive emulates the original session, showing delays, cursor movements, and character by character output as if the commands were being typed and executed in front of you again. It is particularly useful for demonstrations, training, or debugging, allowing users to observe a terminal interaction exactly as it occurred, with the original timing preserved or adjusted. While not a standard core utility on all Linux distributions, various implementations exist, often as Python scripts or similar wrappers around standard tools, aiming to provide this live playback functionality for typescript files.
CAVEATS
scriptlive is not a universally standardized Linux command. Its availability and exact options may vary significantly depending on the distribution, specific package, or whether it's a custom script provided by a user or third-party project. Users should verify its presence and functionality on their specific system. Furthermore, different implementations might have varying levels of support for complex terminal escape sequences (e.g., cursor positioning, colors), potentially leading to rendering discrepancies compared to the original recording.
USAGE NOTES
To effectively use scriptlive, you typically first record a terminal session using the script command. A common way to do this, capturing both output and timing, is:script -t 2>timing.log output.txt
# ... perform your commands here ...
exit
This command creates two files: output.txt (the raw text of the session) and timing.log (timestamped delays between output). Some scriptlive implementations might expect a single combined file, while others, like the example above, might implicitly look for a companion timing file or expect a specific format. Once recorded, you can then replay it using scriptlive, often by simply providing the main output file:scriptlive output.txt
For accurate playback, it's crucial that your current terminal emulator supports the same escape sequences and character sets that were present in the original recorded file.
HISTORY
The concept of recording and replaying terminal sessions dates back to the early days of Unix, with the venerable script(1) command being a foundational tool for this purpose. While script effectively captures raw output and, optionally, timing data, directly replaying it with original timing and visual fidelity was often complex. scriptlive emerged as a specific solution to this challenge, building upon the output format of script. Various independent implementations have appeared over time, often as open-source projects or specialized utilities, driven by the persistent need for clear, reproducible demonstrations of command-line interactions for documentation, training, security analysis, or debugging.