Convert terminal recordings to animated gifs
C Makefile
Pull request Compare This branch is 197 commits ahead of mjording:master.
Latest commit e59fa0c Apr 13, 2017 @icholy fix typo
Failed to load latest commit information.
.gitignore update .gitignore Aug 12, 2013
LICENSE Create LICENSE May 21, 2014
Makefile Allow CFLAGS override Feb 20, 2017 fix typo Apr 13, 2017
io.c spacing Aug 22, 2013
io.h add prototype Aug 22, 2013
string_builder.c indentation Mar 3, 2016
string_builder.h indentation Mar 3, 2016
ttygif.c allow using --fullscreen Nov 8, 2016
ttygif.png update readme Aug 30, 2016
ttyrec.h first commit Aug 22, 2010
utils.c add DEBUG ability Jun 24, 2016
utils.h show convert command output Jun 21, 2016

ttygif converts a ttyrec file into gif files. It's a stripped down version of ttyplay that screenshots every frame.





$ sudo apt-get install imagemagick ttyrec gcc x11-apps
$ git clone
$ cd ttygif
$ make
$ sudo make install


$ sudo dnf install ImageMagick gcc
$ # install ttyrec from source patched ~>
$ git clone
$ cd ttygif
$ make
$ sudo make install

OpenSUSE Leap

$ zypper addrepo
$ zypper refresh
$ zypper install ttygif

Arch Linux

$ git clone
$ cd ttyrec
$ makepkg -i
$ cd ..
$ git clone
$ cd ttygif
$ makepkg -is


$ brew install ttygif


1. Create ttyrec recording

$ ttyrec myrecording
  • Hit CTRL-D or type exit when done recording.

2. Convert to gif

$ ttygif myrecording

On 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 -f

Additional Notes

If you're getting Error: WINDOWID environment variable was empty., then you need to manually set WINDOWID.

export WINDOWID=23068679

If 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.


This will print out all the commands it's trying to run.


The idea and approach was adapted from tty2gif