diff --git a/make b/make index 28b4089..54f3ed1 100755 --- a/make +++ b/make @@ -39,5 +39,12 @@ shell(){ $OCI exec -it xrsh /bin/sh -i -c 'source /mnt/profile && sh' } +recordings(){ + export PATH=$PATH:src/com/isoterminal/mnt + export BROWSER=0 + test -z $1 && find src/tests/vhs/* | xargs -n1 vhs + test -z $1 || vhs $1 +} + test -z $1 && install test -z $1 || "$@" diff --git a/shell.nix b/shell.nix index b883b1e..3045148 100644 --- a/shell.nix +++ b/shell.nix @@ -14,6 +14,8 @@ nodejs_20 cosmopolitan zip + vhs + ffmpeg_6-full ]; diff --git a/src/tests/vhs/alert.tape b/src/tests/vhs/alert.tape new file mode 100644 index 0000000..b611e6d --- /dev/null +++ b/src/tests/vhs/alert.tape @@ -0,0 +1,21 @@ +# Where should we write the GIF? +Output ./../media/terminal/alert.gif + +# Set up a 1200x600 terminal with 46px font. +Set Margin 0 +Set FontSize 19 +Set Width 500 +Set Height 200 +Set CursorBlink true + +# Type a command in the terminal. +Type "alert hello" + +# Pause for dramatic effect... +Sleep 1000ms + +# Run the command by pressing enter. +Enter + +# Admire the output for a bit. +Sleep 3s diff --git a/src/tests/vhs/confirm.tape b/src/tests/vhs/confirm.tape new file mode 100644 index 0000000..fd29be7 --- /dev/null +++ b/src/tests/vhs/confirm.tape @@ -0,0 +1,54 @@ +# Where should we write the GIF? +Output ./../media/terminal/confirm.gif + +# Set up a 1200x600 terminal with 46px font. +Set Margin 0 +Set FontSize 19 +Set Width 500 +Set Height 200 +Set CursorBlink true + +# Type a command in the terminal. +Type "confirm 'do it?'" + +# Pause for dramatic effect... +Sleep 1000ms + +Enter + +# Pause for dramatic effect... +Sleep 1000ms + +Type "y" + +Enter + +# Admire the output for a bit. +Sleep 3s + +# Type a command in the terminal. +Type "in=$(confirm 'do it?')" +Sleep 1000ms + +Enter +Sleep 700ms + +Type "y" +Sleep 1000ms + +Enter +Sleep 1000ms + +Type "echo $in" +Sleep 1000ms + +Enter +Sleep 1000ms + +Type "test $in = true && echo ♥" +Sleep 2000ms + +Enter + +# Admire the output for a bit. +Sleep 3s diff --git a/src/tests/vhs/prompt.tape b/src/tests/vhs/prompt.tape new file mode 100644 index 0000000..d854e9c --- /dev/null +++ b/src/tests/vhs/prompt.tape @@ -0,0 +1,54 @@ +# Where should we write the GIF? +Output ./../media/terminal/prompt.gif + +# Set up a 1200x600 terminal with 46px font. +Set Margin 0 +Set FontSize 19 +Set Width 500 +Set Height 200 +Set CursorBlink true + +# Type a command in the terminal. +Type "prompt 'whatsup'" + +# Pause for dramatic effect... +Sleep 700ms + +Enter + +# Pause for dramatic effect... +Sleep 700ms + +Type "FOSS" + +Enter + +# Admire the output for a bit. +Sleep 3s + +# Type a command in the terminal. +Type "in=$(prompt 'whatsup')" +Sleep 1000ms + +Enter +Sleep 700ms + +Type "FOSS" +Sleep 1000ms + +Enter +Sleep 1000ms + +Type "echo $in" +Sleep 1000ms + +Enter +Sleep 1000ms + +Type "test $in = FOSS && echo ♥" +Sleep 2000ms + +Enter + +# Admire the output for a bit. +Sleep 3s