Blazingly fast terminal recorder that generates animated gif images for the web written in rust
Blazingly fast terminal recorder that generates animated gif images for the web written in rust
[!IMPORTANT] Windows support is in preview. The first Windows-capable release is shipped as a pre-release (
v0.9.0-preview1) so it does not auto-install viacargo install t-recor distro packages — you have to opt in. If you are on Windows, please try it and report what you find on the issue tracker. See Installation on Windows for the exact install command.
brew install t-recsudo port selfupdate
sudo port install t-recNOTE t-rec depends on imagemagick.
brew install imagemagick
cargo install -f t-recNOTE -f just makes sure the latest version is installed
sudo apt-get install libx11-dev imagemagick
cargo install -f t-recsudo apt-get install imagemagick
wget https://github.com/sassman/t-rec-rs/releases/download/v0.5.0/t-rec_0.5.0_amd64.deb
sudo dpkg -i t-rec_0.5.0_amd64.debTL;DR:
sudo snap install t-rec --classic
/snap/bin/t-rec --version
t-rec 0.4.3t-rec can be installed from available AUR packages using an AUR helper. For example,
paru -S t-recIf you prefer, you can clone the AUR packages and then compile them with makepkg. For example,
git clone https://aur.archlinux.org/t-rec.git
cd t-rec
makepkg -sipkgin install t-recOr, if you prefer to build from source,
cd /usr/pkgsrc/multimedia/t-rec
make install[!NOTE] Windows support ships as the
v0.9.0-preview1pre-release. Cargo and distro package managers do not pick up pre-releases by default, so the install command below pins the version explicitly. Once Windows support graduates to stable, the regularcargo install -f t-recwill work.
t-rec uses ConPTY (CreatePseudoConsole) which is available from Windows 10 v1809 (build 17763) onwards. Earlier Windows versions are not supported.
t-rec requires ImageMagick for GIF generation and decor effects, and optionally ffmpeg for MP4 video. Install them with winget:
winget install ImageMagick.ImageMagick
winget install ffmpegMake sure both binaries are on your PATH after install — restart your terminal if needed.
cargo install -f t-rec --version 0.9.0-preview1Grab the Windows zip attached to the v0.9.0-preview1 release, unpack it, and drop t-rec.exe somewhere on your PATH.
By default t-rec spawns cmd.exe. To record a different shell, pass it as an argument or set $env:SHELL:
t-rec powershell.exe
t-rec pwsh.exe
$env:SHELL = "pwsh.exe"; t-rec| tested on those distros |
|---|
| ubuntu 20.10 on GNOME |
| ubuntu 20.10 on i3wm |
| linux mint 20 on cinnamon |
| ArcoLinux 5.4 on Xfwm4 |
t-recor with specifying a different program to launch
t-rec /bin/sh…You can save your preferred settings in a config file to avoid typing them every time.
Quick start:
# Create a starter config file
t-rec --init-config
# List available profiles
t-rec --list-profiles
# Use a profile
t-rec --profile demoConfig file locations (searched in order):
./t-rec.toml (project-local)~/.config/t-rec/config.toml (Linux)~/Library/Application Support/t-rec/config.toml (macOS)%APPDATA%\t-rec\config.toml (Windows)Example config file:
# Default settings applied to all recordings
[default]
wallpaper = "ventura"
wallpaper-padding = 80
# Named profiles for different use cases
[profiles.demo]
wallpaper = "ventura"
wallpaper-padding = 120
start-pause = "10s"
idle-pause = "5s"
[profiles.quick]
quiet = true
idle-pause = "1s"
# Custom wallpaper with $HOME expansion
[profiles.custom]
wallpaper = "$HOME/Pictures/my-wallpaper.png"
wallpaper-padding = 80Using profiles:
# Use default settings from config
t-rec
# Use a specific profile
t-rec --profile demo
# Override a profile setting
t-rec --profile demo --wallpaper-padding 150
# List available profiles
t-rec --list-profilesAvailable config options:
| Option | Type | Description |
|---|---|---|
verbose |
bool | Enable verbose output |
quiet |
bool | Suppress the Ctrl+D banner |
video |
bool | Also generate mp4 video |
video-only |
bool | Only generate mp4, no gif |
decor |
string | Border decoration (shadow, none) |
wallpaper |
string | Wallpaper preset or file path (supports $HOME) |
wallpaper-padding |
number | Padding around recording (1-500) |
bg |
string | Background color (white, black, transparent) |
natural |
bool | Disable idle detection |
start-pause |
string | Pause at start (e.g., 2s, 500ms) |
end-pause |
string | Pause at end |
idle-pause |
string | Max idle time before optimization |
output |
string | Output filename (without extension) |
fps |
number | Capture framerate, 4-15 (default: 4) |
Note: CLI arguments always override config file settings.
For smoother typing animations in demos, increase the capture framerate:
# Smooth typing (10 fps)
t-rec --fps 10
# Very smooth (15 fps)
t-rec --fps 15Note: Higher framerates produce larger files. The default 4 fps is recommended for most use cases.
After recording, t-rec will ask if you also want to generate an MP4 video:
Generating t-rec.gif
Also generate MP4 video? (y/n) ›
(auto-skip in 15s)y to generate both GIF and MP4n or wait 15 seconds to skipTo always generate video without being asked, use the --video flag:
t-rec --video # Generate both GIF and MP4
t-rec --video-only # Generate only MP4, no GIFThe prompt is skipped in quiet mode (-q) or non-interactive environments.
If you are not happy with the idle detection and optimization, you can disable it with the -n or --natural parameter.
By doing so, you would get the very natural timeline of typing and recording as you do it.
In this case there will be no optimizations performed.
Alternatively, you can keep recording idle time before optimization kicks in with the --idle-pause parameter.
This gives viewers time to read the text on screen before the animation jumps to the next change:
t-rec --idle-pause 1s # Show 1 second of unchanged content before optimization
t-rec --idle-pause 500ms # Show 500ms of idle timeNOTE: The default value is 3s.
In order to enable the drop shadow border decor you have to pass -d shadow as an argument. If you only want to change
the color of the background you can use -b black for example to have a black background.
You can record not only the terminal but also every other window. There 3 ways to do so:
-w | --win-id argument to name the Window Id that should be recordedt-rec --ls-win | grep -i calc
Calculator | 45007
t-rec -w 45007TERM_PROGRAM like this:TERM_PROGRAM="google chrome" t-rec
Frame cache dir: "/var/folders/m8/084p1v0x4770rpwpkrgl5b6h0000gn/T/trec-74728.rUxBx3ohGiQ2"
Recording window: "Google Chrome 2"
Press Ctrl+D to end recording
this is how it looks then:
WINDOWID like this:VSCode windowt-rect-rec --ls-win | grep -i code
Code | 27600
# set the WINDOWID variable and run t-rec
WINDOWID=27600 t-rec
Frame cache dir: "/var/folders/m8/084p1v0x4770rpwpkrgl5b6h0000gn/T/trec-77862.BMYiHNRWqv9Y"
Press Ctrl+D to end recording
this is how it looks then:
To contribute to t-rec you can either checkout existing issues labeled with good first issue or open a new issue and describe your problem.
Also every PR is welcome.
No open issues yet, or sync has not completed.