TTY/PTY library

dev-master 2016-03-24 08:02 UTC

This package is auto-updated.

Last update: 2022-11-29 02:44:07 UTC


This library contains functionality for working with TTY/PTYs and related formats and protocols.


  • A ttyrec parser (extracts frames with payload and timing from ttyrec files)
  • A VT100/ANSI Terminal Emulator. Parses escape codes, CSI, OSI etc commands
  • An AsciiRenderer, to render Terminal buffers for replays and debugging
  • Examples in examples/

How to use

composer install
ttyrec tty.log
# execute some commands, like ls, df, etc
php examples/ttyrec-player.php


When starting this project I had no idea what I was getting in to. VT100 is an insane protocol. I'm keeping notes on things I'm learning along the way in

TODO / Next steps:

  • Extract executed commands from tty sessions (initial goal of this project)
  • Solid test-cases based on pre-recorded tty sessions
  • Support more escape codes for coloring, scrolling and other more advanced use-cases


MIT. Please refer to the license file for details.

Brought to you by the LinkORB Engineering team

Check out our other projects at

Btw, we're hiring!