TSM is a state machine for DEC VT100-VT520 compatible terminal emulators. It can be used to implement terminal emulators, or other applications that need to interpret terminal escape sequences.