Version 4 of terminal emulator

Updated 2004-07-30 08:57:48

[...]

[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.

RJMHm. Don't know exactly what you mean. But for the sake of this pages' title an example of an extreme simple terminal emulator follows here. You can adapt 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 <KeyPress> {puts -nonewline $serial %A; break}

The break prevents local echot of typed characters on the text widget.


See also A simple serial terminal


Category Glossary