3 ms·
I recently started using this for recording all my terminal sessions (without upload). It's pretty neat to be able to go back and replay any session I had. I al
by moyix 3y ago
I recently started using this for recording all my terminal sessions (without upload). It's pretty neat to be able to go back and replay any session I had. I also threw together a small tool to grep through the output, although it's currently pretty slow:
https://github.com/moyix/termgrep https://github.com/moyix/termgrep
I stuck this in my .profile to record any session started under tmux and avoid recursive recording. It compresses the logs with zstd when you exit.
# Check if not already recording and inside tmux
if [ -z "${ASCIINEMA_REC+x}" ] && [ ! -z "$TMUX" ]; then
export ASCIINEMA_LOGFILE=/fastdata/asciinema_personal/termlog_$(date +%Y-%m-%d_%H.%M.%S.%N).log
asciinema rec -q --stdin "$ASCIINEMA_LOGFILE"
zstd -T0 --rm "$ASCIINEMA_LOGFILE"
exit
fi
Two weeks of logs (with fairly heavy usage) are about 1GB:
$ du -csh /fastdata/asciinema_personal/\*.zst | tail -1
1.3G total