ttyrec

This is an old revision of this page, as edited by Citation bot (talk | contribs) at 04:11, 7 February 2021 (Misc citation tidying. | You can use this bot yourself. Report bugs here. | Suggested by Abductive | Category:Unix software‎ | via #UCB_Category 98/135). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.

A NetHack recording being replayed using termrec

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.[1]

Recorders and players

  • original ttyrec[1] (Unix)
  • Term::TtyRec[2] (Perl)
  • Term::TtyRec::Plus[3] (Perl)
  • Tie::Handle::TtyRec[4] (Perl)
  • termrec[5] (Win32, Unix)

Playback only

  • TTYPLAYER[6] (Java)
  • IPBT[7] (Unix)

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 (0-based) or since the Unix epoch
  • usec – 0..999999 microseconds
  • len – length of the payload

and the actual payload written as text with vt100 control codes.

The format doesn't 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%G for UTF-8 or \e%@ for not UTF-8 and as \e[8;Y;Xt for size, but not all players will understand these codes.

References

  1. ^ a b "Ttyrec: A tty recorder".
  2. ^ https://metacpan.org/module/Term::TtyRec
  3. ^ https://metacpan.org/module/Term::TtyRec::Plus
  4. ^ https://metacpan.org/module/Tie::Handle::TtyRec
  5. ^ "1KB: Software/Termrec".
  6. ^ http://www-masu.ist.osaka-u.ac.jp/~kakugawa/misc/ttyplayer/index-en.shtml
  7. ^ "IPBT: A high-tech ttyrec player for Unix".
  8. ^ "Archived copy". Archived from the original on 2006-06-21. Retrieved 2006-07-06.{{cite web}}: CS1 maint: archived copy as title (link)
  9. ^ "#68556 - [patch] adding timings to script - Debian Bug report logs".