VTE 是一个很流行的虚拟终端库，很多虚拟终端都是基于 VTE。VTE 是linux下的一款控制终端程序，十分小巧。包括 Gnome 下的 Gnome Terminal，Xfce 的 Terminal，Sakura，Tilda 等等。
VTE library inserts terminal capability strings into a tree of tables.
You could say that VTE is something of a research project of mine, based on the simple question: "if programs can use a termcap file (through either libtermcap or curses or ncurses) to determine how to drive a terminal, why cant a terminal emulator use a termcap file to determine how to behave?"
Update: the answer is most likely "because applications which use curses have more detailed information than that which is found in termcap".
What does VTE include?
VTE includes a library (libvte) which implements such a terminal emulator widget for GTK+ 2.2/2.4, and a sample application (vte) which wraps that widget in a GTK window. Because Im more concerned with whether or not it works, all settings are hard-coded to whatever I needed to test the last time I touched it. If you actually want to use the widget to get work done, you should probably be using gnome-terminal.
How does it work?
The VTE library inserts terminal capability strings into a tree of tables, and then uses it to determine if data received from a pseudo-terminal is a control sequence or just random data. The sample program "interpret" illustrates more or less what the widget sees after it filters incoming data.