Ttyrec
Image:termrec wwwwolf.png|thumb|300px|A NetHack recording being replayed using termrec
ttyrec is a program or its file format capable of recording the TTY output of a text-mode program together with timestamps and then replaying it.
It is widely used for example in the NetHack community for storing game replays.
It is similar to the script command, but also allows for pausing, slowing down or speeding up playback. It can also stream the recording on the network and be used to transfer files with uudecode.
Recorders and players
- original ttyrec ovh-ttyrec Term::TtyRec Term::TtyRec::Plus Tie::Handle::TtyRec
- ''termrec''
Playback only
TTYPLAYER- ''IPBT''
Technical file format specification
Each chunk consists of a header using 32bit unsigned little-endian numbers:sec - seconds, either since the beginning of the recording or since the Unix epochusec - 0..999999 microsecondslen - length of the payloadand the actual payload written as text with vt100 control codes.
The 32-bit sec range makes the format susceptible to the Year 2038 problem.
The format does not contain any information about the character set used nor about the terminal size needed to play back the file. termrec will inject this information as \e for UTF-8 or \e for not UTF-8 and as \e'Y'X for size, but not all players will understand these codes.
Related formats
nh-recorder- Joey Hess's modifications of script
- ''RealLogs''