Originally Posted by geekmaster
You could "steal" it from matan's myts (onscreen terminal emulator). I plan to do my own though, due to that GPL virus that lurks in dark corners of this forum.
There is a parser for the control character sequences in the public domain, see:
Page down to: "An Implementation"
Reading the background information would be a good idea also:
Plus - given enough time, I can probably find my copy of the Data General 'smart' terminal manuals (which also did VTsomething emulation).