Loading Ian Piumarta's Smalltalk terminal emulator code
Thu 4 Sep 2025 09:06 CEST
Back in 2002/2003, Ian Piumarta wrote an “essentially complete” VT102 terminal emulator for Squeak Smalltalk.1
Here are his unmodified original changesets, encoded using the MacRoman character set; these do not load directly into current Squeak images as-is:
The problem is not just that they’re encoded using MacRoman—Squeak still has support for that—but that there are punning uses of strings to represent bytewise mappings, rather than characterwise mappings.
The first step to getting them loadable is to convert them to UTF-8. I did this using
emacs2 because both Squeak itself and iconv(1)
choked on some of the
tricky encodings going on in the files. A subsequent step will be to repair the tricky parts,
re-writing them to hopefully use in-image Unicode support.
The Squeak Smalltalk language has also changed a little since 2003: assignment is no longer ←
(written using an underscore, _
), but is instead the digraph :=
; it is no longer permitted
to store into method or block arguments; and so on. Fixing these issues yields the following:
Now, filing in telnet.301.cs
yields an error in TeletypeMorph class »
initializeCharacterClasses. This is the main (?) place involving 8-bit character set
assumptions that will have to be revisited. Changing that method temporarily to delete its
actual body, replacing it with the commented-out table taken directly from xterm, allows the
fileIn to complete.
Filing in PseudoTTY-3.2-4.st
appears to succeed without problems.
Next steps will be seeing if all this code actually runs!