Neha Patil (Editor)

Ttyrec

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Ttyrec

ttyrec is a program and/or its file format capable of recording the TTY output of a text-mode program together with timestamps and then replaying it.

Contents

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/players

  • original ttyrec (Unix)
  • Term::TtyRec (Perl)
  • Term::TtyRec::Plus (Perl)
  • Tie::Handle::TtyRec (Perl)
  • termrec (Win32, Unix)
  • Playback only

  • TTYPLAYER (Java)
  • IPBT (Unix)
  • Technical file format specification

    Each chunk consists of a header using 32bit 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.

  • nh-recorder
  • Joey Hess's modifications of script
  • RealLogs
  • References

    Ttyrec Wikipedia