[[...]] [[Describe rxvt and the one Don distributes with [Expect].]] ---- I've seen the expect example, and it works amazingly well. What I would like to know is whether or not it's possible to get the same effect with pure [tcl/tk]. The acid test would be to run [vi] within a [tk]-based emulator without using the expect extension. [RJM] Hm. Don't know exactly what you mean. But for the sake of this pages' title an example of an extremely simple terminal emulator follows here. You can adapt/extend it for your own purpose. set serial [open com1 r+] fconfigure $serial -mode "9600,n,8,1" -blocking 0 -buffering none -translation binary fileevent $serial readable {.t insert end [read $serial]} pack [text .t] bind .t {puts -nonewline $serial %A; break} The ''break'' prevents local echo of typed characters on the text widget. ''Exactly what I mean: I want to exec vi and have its input and output managed through a tk widget. It has nothing to do with a serial communications port.'' ---- [DL] I think the answer to the original question may have different answers depending on whether you're on a UNIX-based platform (which would include MacOS) or a Windows platform. On UNIX, you need pseudottys, something vanilla Tcl just doesn't provide support for - except with the Expect extension. On Windows, there is no unified mechanism for interacting with other programs. The simple script above merely opens a connection to a serial port. If your idea of a terminal emulator is to interact with a serial port, then yes you can get by with a pure Tcl script. The [Expect] terminal emulator is pretty full-featured. It supports/understands: * scrollbars * both termcap and terminfo * meta-key (so things like zsh, emacs, etc work) * selections * standout mode, function keys, etc, etc, etc. Plus, it supports screen-scraping. If you want to understand it in detail, the [BOOK Exploring Expect] has a code walk-through of the terminal emulator. ---- See also [A simple serial terminal] ---- [Category Glossary]