Skip to content

Instantly share code, notes, and snippets.

@tngTUDOR
Created November 4, 2022 12:50
Show Gist options
  • Save tngTUDOR/f94e074dad904b87d63c95267adf472e to your computer and use it in GitHub Desktop.
Save tngTUDOR/f94e074dad904b87d63c95267adf472e to your computer and use it in GitHub Desktop.
recording a terminal session inside linux container

Recording a terminal session with ttyrec + ttygif

ttyrec is easy to install in many platforms

Use it inside the container, to produce the output file in a volume, and then use ttyrec to produce a GIF from the host.

  • ttyrec - It's one apt install ttyrec away (or dnf)
  • ttygif idem

Example

docker run --rm -it -v `pwd`:/opt/recordings ubuntu:latest
apt update
apt install ttyrec
cd /opt/recordings
ttyrec my_session
# hack hack hack
exit
exit

in the host, use ttygif

sudo apt install ttygif
ttygif my_session

If using kitty terminal, there's no window decoration (the opposite of Konsole for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment