typescript

nicolaw 19th July 2019 at 9:06am
TechnicalNotes
# Start recording your terminal (type exit or press Control-D to stop recording):
script --timing=typescript.timing typescript
# Play back your recording:
scriptreplay --timing=typescript.timing typescript

There are various other improved playback tools (like https://github.com/scoopex/scriptreplay_ng) that you can use to scrub through the playback like you would a YouTube video.

Furthermore, if you add this (hopefully very generic Bourne shell compatible stuff) to the end of your ~/.profile, it will automatically log every interactive terminal shell session for you into ~/log/.

# record the terminal session
if test -t 0 ; then
    if ! [ -d "$HOME/log" ] ; then
        mkdir -p "$HOME/log"
    fi
    if type script >/dev/null 2>&1 ; then
    typescript="$HOME/log/typescript.`date +%Y%m%d-%H%M%S`"
        exec script "--timing=$typescript.timing" "$typescript"
    fi
fi