How does one go about creating screencasts, like this one?


Also see the related question: Should the use of screencasts be encouraged?


4 Answers 4


A good way is to use screenkey (to display keypresses) and byzanz-record (which records directly to small gifs).They are included in the Debian repositories, so they can be easily installed with

sudo aptitude install screenkey byzanz-record

Create a small script gifrec and make it executable with chmod +x gifrec (and add it to your path or ~/bin/ if you want to):

# Usage: screencast-window [ARGUMENTS_FOR_BYZANZ_RECORD...]
# Take a video capture, in GIF format, of a single window.
# Written in 2010 by Suraj N. Kurapati <https://github.com/sunaku>

echo 'Usage: gifrec filename.gif (--duration=5)\n'
echo 'After selecting window place mouse over this window.'
echo 'When done recording click on mouse (to select this window'
echo 'and press Ctrl-c - this stops the recording.\n'
echo 'The gif can be directly uploaded to a Stackexchange post'

echo 'Select the window you want to video capture...'
byzanz-record $(xwininfo | awk '
  /Absolute upper-left X/ { x = $4 }
  /Absolute upper-left Y/ { y = $4 }
  /Width/                 { w = $2 }
  /Height/                { h = $2 }
  END                     { print "-x", x, "-y", y, "-w", w, "-h", h }
')  --delay=3 --duration=60 -v "$@" 

To perform a screencast do the following:

  1. Start screenkey
  2. Open a terminal and start Vim. Place the terminal in a way that the screenkey output is centered above it
  3. Open another terminal and run gifrec example.gif. The scripts asks you to select a window: double click the terminal with Vim to select this window and focus it. Then move the mouse over the the other terminal
  4. Do what you want to show with Vim after the recording message appears
  5. To stop the recording, left-click with the mouse in the non-Vim-terminal and press Ctrl-c
  6. Run pkill screenkey to stop screenkey.

This results in a gif like this (30 seconds, 219kb):

enter image description here


I used a custom-made tool to create the mini-screencasts in my answer: https://github.com/KeyboardFire/mkcast

It's quite simple to use for Vim screencasts (only tested in GNOME on Ubuntu):

  1. Create a gnome-terminal profile called mkcast.

  2. Check "Run a custom command instead of my shell" under the Title and Command menu of the preferences window, and enter vim in the text entry field.

  3. When you want to take a screencast, simply press Alt+F2, type newcast, and press Enter.

  4. When finished taking the screencast, quit Vim (:q!). The finished screencast should now be saved to ~/out.gif.


Check out showterm.

"Showterm lets your record a terminal session exactly as you experience it, right down to the syntax highlighting."



It essentially combines these technologies (which it credits on the website):

  • term.js: Christopher Jeffrey's awesome tty.js
  • script: the long-forgotten UNIX tool for recording terminal sessions.
  • ttyrec: Saturo Takabayashi's upgrade of script
  • 1
    Can you use this on StackExchange sites (inline)? It looks like it uses a lot of HTML/JS... I suppose you could link to it, but inline would be better, IMHO. Feb 4, 2015 at 16:12
  • I don't see a big reason to have the cast embedded as a gif. Showterm will auto-upload and echo out a URL to view.
    – shmup
    Feb 4, 2015 at 16:14

You can also use ttygif:


  • 3
    This is a link-only answer. I suggest that you say a bit more: "ttygif is a program that uses ImageMagick to convert ttyrec files into GIFs". Feb 4, 2015 at 4:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .