ttyrec

From Wikipedia, the free encyclopedia
Jump to: navigation, search
A NetHack recording being replayed using termrec

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.

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/players[edit]

  • original ttyrec [1](Unix)
  • Term::TtyRec[2] (Perl)
  • Term::TtyRec::Plus[3] (Perl)
  • Tie::Handle::TtyRec[4] (Perl)
  • termrec [5] (Win32, Unix)
  • shelr [6] - recording, payback, publishing (Unix, Ruby)

Playback only[edit]

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

Technical file format specification[edit]

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 or \e[@ for Unicodeness and as \e[8;Y;Xt for size, but this is a hack outside of the format specification, not guaranteed to work on all terminals.

Related formats[edit]

References[edit]

  1. ^ a b http://0xcc.net/ttyrec/
  2. ^ https://metacpan.org/module/Term::TtyRec
  3. ^ https://metacpan.org/module/Term::TtyRec::Plus
  4. ^ https://metacpan.org/module/Tie::Handle::TtyRec
  5. ^ http://angband.pl/termrec.html
  6. ^ http://shelr.tv/about
  7. ^ http://www-masu.ist.osaka-u.ac.jp/~kakugawa/misc/ttyplayer/index-en.shtml
  8. ^ http://www.chiark.greenend.org.uk/~sgtatham/ipbt/
  9. ^ http://nh-recorder.sourceforge.net/
  10. ^ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=68556

External links[edit]