FUN WITH LINUX

Recording terminal-sessions

13 June 2016

Recording any terminal session to a gif is easy. I use ttyrec to record a session and ttygif to convert it to GIF.

Installation

First we have to install the Go-language, ttyrec and git:

apt-get install golang ttyrec git

Using our installed go-environment, we can create a directory for our downloaded go-programs and install ttygif(yes, it’s a go-prog):

mkdir /opt/goprogs
export GOPATH=/opt/goprogs/
go get github.com/sugyan/ttygif

Recording a (vim)session

Recording a terminal-session using ttyrec is easy. I will record a vim-session and I want to start the session in english and without any special initialisations. Therefore I have to tweak the settings a little bit:

ttyrec -e "env LANG=en_US.UTF-8 vim -u NONE" recordfile

Converting the recorded file to GIF

Converting to gif is easy like this:

$GOPATH/bin/ttygif -in recordfile -out example.gif

Example recording

[ vim  Tricks  TerminalEmulator  Shell  ]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 Unported License.

Copyright 2015-present Hoti