
On UNIX, you need pseudottys, something vanilla Tcl just doesn't provide support for - except with the Expect extension. It has nothing to do with a serial communications port.ĭL 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. The break prevents local echo of typed characters on the text widget.Įxactly what I mean: I want to exec vi and have its input and output managed through a tk widget. You can adapt/extend it for your own purpose.įconfigure $serial -mode "9600,n,8,1" -blocking 0 -buffering none -translation binaryįileevent $serial readable But for the sake of this pages' title an example of an extremely simple terminal emulator follows here. The acid test would be to run vi within a tk-based emulator without using the expect extension. What I would like to know is whether or not it's possible to get the same effect with pure tcl/tk. I've seen the expect example, and it works amazingly well. If you want to understand it in detail, the BOOK Exploring Expect has a code walk-through of the terminal emulator. standout mode, function keys, etc, etc, etc.meta-key (so things like zsh, emacs, etc work).The Expect terminal emulator is pretty full-featured. A simpler version is at handling of ANSI terminals with Expect. There is a rather full-featured terminal emulator using a Tk text widget distributed as an example with Expectk - it can be found next to - term_expect, tkterm and virterm are of interest (as of 05/12, NIST no longer seems to be hosting a browsable expect repository - see instead ). Allows mixing multiple fonts at the same time, including Xft fonts.


Ian Bell's "8052 Development for Linux Users" and Melissa Schrumpf's post on automation of miscellaneous devices both illustrate how experienced developers think about terminal emulation in projects with specialized hardware.Īn interesting piece of software noticed on freshmeat is What:Ĭlone of rxvt modified to store text in Unicode and to use locale-correct input/output. This page has a few general remarks on the role of terminal emulators.
