termrec records complete terminal sessions for later replay and workflow analysis.
It stores terminal input, terminal output, event timing, session metadata, and a
before/after Git snapshot when recording starts inside a repository.
It is not screen video. It records the text and terminal control sequences sent
through a pseudo-terminal, so recordings are normally much smaller than MP4 files
and remain replayable with scriptreplay.
- Linux
- Bash 4+
scriptandscriptreplayfromutil-linuxtar- Git is optional
On Ubuntu these tools are normally already installed.
git clone https://github.com/Extraden/termrec.git
cd termrec
bash install.shMake sure ~/.local/bin is in PATH:
export PATH="$HOME/.local/bin:$PATH"Add that line to ~/.zshrc to keep it permanently.
Record a complete login-shell session:
termrecEverything launched inside that shell is recorded: Zsh commands, Git, Vim,
Neovim, compilers, debuggers, and other terminal programs. Exit the nested shell
with exit or Ctrl-D to stop recording.
Record one command:
termrec vim --clean bigint.cpp
termrec nvim --clean bigint.cpp
termrec makeGive a session a readable label:
termrec --name exam -- vim --clean bigint.cpp
termrec start --name webserv -- zsh -lList recordings:
termrec listReplay the latest recording, limiting idle pauses to two seconds:
termrec replay latestReplay twice as fast:
termrec replay latest --speed 2Show recording metadata:
termrec summary latestCreate a shareable archive:
termrec pack latestPrint the path of a recording:
termrec path latestCheck dependencies:
termrec doctorBy default, recordings are stored under:
~/.local/state/termrec/
├── sessions/
└── archives/
Change this location with TERMREC_HOME:
export TERMREC_HOME="$HOME/terminal-recordings"A session contains:
input.log bytes entered into the pseudo-terminal
output.log terminal output and control sequences
timing.log timing and stream information
meta.txt command, directory, terminal, version, exit status
git/ optional before/after status and patches
Exam-style Vim without user configuration:
termrec --name exam -- vim --clean bigint.cppClean Neovim without NvChad or another user configuration:
termrec --name clean-nvim -- nvim --clean bigint.cppNormal Neovim with the user's configuration:
termrec nvim bigint.cpptermrec captures bytes that reach the pseudo-terminal. Terminal-emulator or
desktop shortcuts intercepted before that point are not captured. For example,
Ctrl-Shift-C may be handled by the terminal itself rather than by the recorded
shell.
The Git snapshot only covers the repository in which termrec was started. If a
long shell recording moves between several repositories, their terminal activity
is still recorded, but automatic before/after patches are not collected for every
repository.
The input log contains everything delivered to the terminal, including hidden password input. Recordings are created with permissions restricted to the current user, but inspect them before sharing or publishing.
Do not commit recordings to this repository. They are stored outside the checkout by default.
make testMIT