Because ANSI escape sequences can move the cursor, there are many ways to draw a terminal screen. Complex screens are often drawn different parts at a time, or overwrite old values.
This program captures the output and prints it top to bottom.
Related: https://github.com/buildkite/terminal-to-html/