terminal session recorder/player - Printable Version
+- nixers (
+-- Forum: Development & Graphics (
+--- Forum: Programming On Unix (
+--- Thread: terminal session recorder/player (/Thread-terminal-session-recorder-player)

terminal session recorder/player - z3bra - 21-05-2015

I wrote a simple shell script to record and play terminal session. It makes use of script(1) and scriptreplay(1) (should be installed on most distros).

# start recording a script, and upload it in base64 to sprunge
# usage: nx-termcast [url]

nx_upload() {
    # feel free to override, if you know what you're doing
    curl -sT-

nx_record() {
    script --timing=timing typescript
    # make a motherfucking tarbomb
    tar cz . | base64 | nx_upload

nx_replay() {
    curl -s "$*" | base64 -d | tar xz
    scriptreplay timing typescript

# that's to prevent the motherfucking tarbombs
cd $(mktemp -d)

# give the impression of a clean session

# either record or play, your choice
test -n "$1" && nx_replay "$*" || nx_record

Save the above in a file (preferrably named "nx-termcast") and set the execution bits on it.

Now to start recording, simply run


then everything you type, and everything that appears on the terminal will get recorded. Beware when using curse based applications though, as they will be drawn with the same size in the replay. For better result, try to record with a window of 80 columns and 24 lines.

To finish recording, just run "exit" or close the pseudo-terminal with ^D. This will automatically upload your script in tar.gz format to sprunge (base64 encoded), and print the URL that you can use to access it to stdout. Just copy it, and share it!

To replay a script recorded via this script, just run:


Feel free to try to play cast in your terminal, to have an idea of how it works ;)

And now it's your turn! Share this script, so that people start sharing scripts all around the interweb!

RE: terminal session recorder/player - jcalve - 21-05-2015

RE: terminal session recorder/player - Webtm - 22-05-2015

This is pretty cool.
Oh nevermind, its just a typescript...