ThisI would prefer to use specialized tools to convert script output into plain text, which is constantly supported and well tested, over custom regexp. So this did job for me:
$ cat typescript | ansi2txt | col -bp > typescript.txt.bp $ cat -v typescript.txt.bp script command captures into typescript file ansi2txt - converts ansi code with escapes like colorcodes, backspaces etc into regular text, however I found that couple escapes still left. col -bp - removed them completely.
I’ve tested this on latest Ubuntu disco, and it works.