Simple python program to render text containing ansi escape codes
Fix error deleting nonexistent characters; add BEL


browse  log 



You can also use your local clone with git send-email.

A simple python program to render a file with ansi codes into plain text.

The main use case is to render the output of the Linux 'script' command into a sensible-looking log of a terminal session.

This is a very basic script and so doesn't handle all ANSI escape codes, only those which I have come across.

The rendered output will stop when the terminal enters the 'alternate screen' (i.e. in a pager or an editor), and resume when it is exited. This means that the output of less/vim/whatever won't be included in the result. There is no sensible or easy way to render the output of an interactive session into a static text file!

Input is read from stdin and written to stdout.