TTYPlayer.js

TTYPlayer is a player that playback terminal session.

How To use

Install ttyrec

Before use ttyplayer, you should install ttyrec, and record your tty session using ttyrec.

For Mac OSX users, ttyrec can be installed with homebrew:

brew install ttyrec

Record tty

Use ttyrec command to record terminal session:

ttyrec your.rec

Use exit command to finish.

exit

New TTYPlayer

Include ttyplayer.min.css and ttyplayer.min.js in your page, then create a player:

new TTYPlayer({
  parent: document.getElement('player-parent')
}).load('/your.rec')

Now we get one:

With markdown

Read my blog and the markdown source code to know how to generate ttyplayer in markdown.

Notice

The default cols and rows are 80 and 20. Before you record, make sure your terminal size is cols 80 and rows 20.

Or give a custom size:

new TTYPlayer({
  parent: document.getElement('player-parent'),
  cols: 90,
  rows: 30
}).load('/your.rec')

Github

https://meowtec.github.io/ttyplayer.js/

Starts or pull requests welcome.