The script command is a Unix utility that records a terminal session.
The recorded format of script consists of plain-text timing information (for the whole session) and verbatim command output, including whatever ANSI escape code the program has printed for formatting.
[1] The util-linux scriptreplay command offers a replay function to its script, which supports using an extra timing file for character-level information.
[2][3] Some online services, such as the now-defunct shelr.tv, can also show the format as a low-bandwidth alternative to video screencasts.
However, some interactive programs (such as Python) do not echo their standard input when run under the resulting shell, although they do when run under the script command, again due to the detection of a terminal.