Thursday, May 14, 2009

VIRT

A decade ago, I created a program called virt. virt created terminal emulators (or partial emulators) based on descriptions in the termcap/terminfo databases.

Suppose you are innocently watching someone's telnet session with a packet sniffer. If this someone is using a program with a curses interface, you are likely to see large amounts of garbage. This is because every cursor movement is going to generate an escape sequence that tells their terminal where to move the cursor to.

So to create a pretty interface for your telnet watching packet sniffer, you need to be able to interpret the escape sequences. It is pretty easy to write one by hand; but what happens when someone uses a different type of terminal?

Being a lazy programmer, I wrote a program that would generate the code I needed. A lot of flex (the GNU lexer) was used in conjunction with ncurses. So you could tell virt to generate code for a VT100, VT220, or whatever was in the terminfo/termcap databases.

It actually worked very well, but there is little market for such a program and I just let it die.

No comments: