The example named tkterm implements a VT100 terminal emulator. The tkterm program can be used as a direct replacement for the more familiar emulator programs xterm or rxvt.
The sources for tkterm are contained in three separate files.
The main procedure is in
The tkterm program simulates the VT100 display using
an ordinary Tcl/Tk text widget.
C routines in ET()
functions to insert characters into their proper
places within the text widget.
The
The tkterm program is an example of an application that could not be coded in pure Tcl/Tk, since Tcl/Tk has no provisions for dealing with pseudo-TTYs or TTYs in ``raw'' mode. But even if it could, we would probably still want to use some C code, since it seems unlikely that a Tcl/Tk script would be able to process the VT100 escape sequences efficiently.