ttygif converts a ttyrec file into gif files. It's a stripped down version of ttyplay that captures every frame.
$ sudo apt-get install imagemagick ttyrec gcc x11-apps
$ git clone https://github.com/icholy/ttygif.git
$ cd ttygif
$ make
$ sudo make install$ sudo yum install ImageMagick gcc
$ # install ttyrec from source ~> https://github.com/mjording/ttyrec
$ git clone https://github.com/icholy/ttygif.git
$ cd ttygif
$ make
$ sudo make install$ brew install https://raw.githubusercontent.com/icholy/ttygif/master/ttygif.rb1. Create ttyrec recording
$ ttyrec myrecording- Hit CTRL-D or type
exitwhen done recording.
2. Convert to gif
$ ttygif myrecordingOn OSX optionally you can set a -f flag which will bypass cropping which is needed for terminal apps which aren't full screen. Both standard Terminal and iTerm apps are supported.
$ ttygif myrecording -fIf you're getting Error: WINDOWID environment variable was empty., then you need to manually set WINDOWID.
export WINDOWID=23068679If you're on Ubuntu, you can use xdotool to find the WINDOWID
$ sudo apt-get install xdotool
$ export WINDOWID=$(xdotool getwindowfocus)If you're having issues, then export the TTYGIF_DEBUG env variable.
export TTYGIF_DEBUG=1This will print out all the commands it's trying to run.
The idea and approach was adapted from tty2gif

