Looking for a new opportunity as DevOps engineer
I am currently seeking a new opportunity as a DevOps Engineer, available from February 2026. I am open to remote or hybrid work from Prague, Czechia (Europe), for a long-term, full-time position or B2B contract - 300 EUR / daily. Please feel free to contact me for further details. You can also review my professional background on my LinkedIn profile.
Resetting asciinema with Scroll Stacking
Your asciinema recording looks broken: newlines don’t work, old text gets overwritten, or the screen fills with garbage. This simple tutorial shows how to reset the terminal screen mid-recording using scroll stacking. Fix messy casts without starting over - just edit the file!
Why You Need This#
Newlines fail and text overwrites because terminals have scrollback limits and state corruption during long recordings. Commands like ls or cat print without proper line wrapping, leaving a cluttered screen that ruins playback. Scroll stacking resets the terminal to a clean state at any point (like 12.5 seconds) so your demo continues fresh.
Common problems this fixes:
- Lost newlines: Output stacks on one line instead of wrapping
- Scrollback overflow: Old commands stay visible when they shouldn’t
- State corruption: Colors, cursor position, or margins get messed up
- Multi-step demos: Want clean breaks between sections in one file
How Scroll Stacking Works#
Instead of clear (which only erases visible screen), ESC c (\u001bc) does a full terminal reset - clears screen, resets margins, cursor, colors, everything. The [12.5, “o”, “\u001bc”] event injects this at timestamp 12.5 seconds during playback.
Quick Fix Steps#
- Backup your
demo.castfile - Open in any text editor (VS Code, nano, etc.)
- Find where mess starts (check timestamps)
- Add this exact line on its own:
[12.5, "o", "\u001bc"]
- Save and play:
asciinema play -s=10 demo.cast(increase speed ten fold)
Before/After Example#
Broken cast (newlines lost, text overwritten):
[0.0, "o", "dir1/"]
[1.2, "o", "file1 file2 file3"] // Should be new line!
[2.1, "o", "pwd"] // Overwrites above
Fixed with reset:
[0.0, "o", "dir1/"]
[1.2, "o", "file1 file2 file3"]
[12.5, "o", "\u001bc"] // ← Screen resets here
[13.0, "o", "pwd"] // Fresh clean screen
Looking for a new opportunity as DevOps engineer
I am currently seeking a new opportunity as a DevOps Engineer, available from February 2026. I am open to remote or hybrid work from Prague, Czechia (Europe), for a long-term, full-time position or B2B contract - 300 EUR / daily. Please feel free to contact me for further details. You can also review my professional background on my LinkedIn profile.