4 ms·
I wrote a VT100 (+ Sun extensions) emulator in PostScript that had a magical "^_PostScript Code^]" escape sequence that let you download arbitrary PostScript co
by DonHopkins 3y ago
I wrote a VT100 (+ Sun extensions) emulator in PostScript that had a magical "^_PostScript Code^]" escape sequence that let you download arbitrary PostScript code into the NeWS window server (which could do anything you want)! Also ^A would print out the stack, because why not? ;)
https://donhopkins.com/home/code/term.ps.txt https://donhopkins.com/home/code/term.ps.txt
It also supported the <ESC>#8 "fill screen with E" test sequence, just so it could pass VTTest, plus a few extra Sun and AAA sequences that my slave driving boss Hugh Daniel demanded (since he was from Ann Arbor). Yes, a company actually called "Wedge Computer, Inc." paid me to write it!
There are also some subtleties about missing numeric arguments that VTTest checks. My SoftTTY emulator would detect syntax errors in escape sequences, which implied you were trying to test it with VTtest, so then it would change the cursor to the shape of a hand giving you the finger (shape-error-cursor), and flash it 20 times, to flip Hugh off for subjecting my terminal emulator to VTTest.
https://en.wikipedia.org/wiki/Vttest https://en.wikipedia.org/wiki/Vttest
/ps-string-prefix {
/ps-string 256 string def
/ps-string-len 0 def
/termulate-char //termulate-ps-string def
} def
/termulate-ps-string {
dup 27 eq {
pop
reset-termulator
ps-string 0 ps-string-len getinterval cvx
{ exec } stopped pop
} {
ps-string ps-string-len 3 -1 roll put
/ps-string-len ps-string-len 1 add def
ps-string-len ps-string length eq {
/ps-string
ps-string-len dup add string
ps-string 1 index copy pop
def
} if
} ifelse
} def
I used it for writing a Lisp "Little Backwards Chainer" program that would download a tree of dirty knowledge base symbols into the server to define a corresponding tree of pop-up pie menus, so I could browse the Lisp data structures as pie menus to debug the program.
https://donhopkins.com/home/archive/lisp/little-backwards-chainer.lisp https://donhopkins.com/home/archive/lisp/little-backwards-ch...
; Write dirty nodes to the NeWS server in PostScript, and mark them as
; clean.
(defun sweep ()
(clean-tree '*KB*))
(defun clean-tree (node)
(cond ((get node 'dirty)
(send-node node)
(putprop node nil 'dirty)))
(cond
((null (node-alist node)) nil)
(t (mapcar #'(lambda (link)
(clean-tree (link-node link)))
(node-alist node))
nil)))
(defun send-node (node)
(ps-make-node node (node-sexp node)
(node-associated-atom node)
(node-alist node)))
; Magic control characters the PostScript terminal emulator responds to.
(setq StartPS "^_") ; Ctrl-_: begin trojan horse
(setq EndPS "^]") ; Escape: end and execute trojan horse
; Write out a NeWS menu definition, with the right control characters to
; make the PostScript terminal program (SoftTTY) execute it.
(defun ps-make-node (name sexp associated-atom alist)
(msg "% Sending " name "...")
(msg StartPS "userdict /" name " [" N)
(msg " " (list 'Name= name) " {" (ncons name) " print}" N
" " (list 'Sexp= sexp) " {" (ncons sexp) " print}" N
" " (list 'Atom= (fact-name associated-atom))
" {" (ncons (fact-name associated-atom)) " print}" N)
(mapcar #'(lambda (link)
(msg " " link " /" (link-node link) " cvx" N))
alist)
(msg "] /new DefaultMenu send put" N)
(msg name " /Clockwise false put" N)
(cond ((eq name '*KB*) (msg "/ClientMenu *KB* def" N))) ; kludge
(msg EndPS N))
Hugh was the author of ColorToy and ColorTool, which lets you play with and change all the user interface colors (even to dynamic random procedural colors that changed every time it paints, which was the most fun, and useful for debugging drawing, incremental screen updating, and clipping bugs!)
https://donhopkins.com/home/archive/NeWS/news-tape/utilities/colortool/colortool https://donhopkins.com/home/archive/NeWS/news-tape/utilities...
- jacquesm 3y agoLet's see if I can accurately predict which titles will have a comment by you under them ;)
- shaunxcode 3y agothis is an awesome comment. I have spent many hours (days?) reading through your site - especially the NeWS stuff!
- DonHopkins 3y agoThanks! Some of the best stuff is hard to find. I just had ChatGPT analyze the code, describe the rules, and explain the cultural references in an OPS-5 program I wrote in that same AI class (from Jim Hendler), in the aftermath of the Morris Worm and Iran Contra Scandal. https://www.donhopkins.com/home/archive/lisp/mylisp/ollie https://www.donhopkins.com/home/archive/lisp/mylisp/ollie https://chat.openai.com/share/bd1e4fc6-c1c1-499f-aca5-12cbd9afe33a https://chat.openai.com/share/bd1e4fc6-c1c1-499f-aca5-12cbd9... The intruder was able to log into the professor's Sun 3/60 workstation from mimsy thanks to his .rhosts file! Things were so much simpler those days. ; host mimsy (make file ^name passwd ^writable yes ^owner root ^host mimsy) (make user ^user root ^password unknown ^host mimsy) (make user ^user casper ^password unknown ^host mimsy) (make rhosts ^user casper ^host mimsy ^ruser casper ^rhost tycho) (make user ^user hendler ^password unknown ^host mimsy) (make rhosts ^user hendler ^host mimsy ^ruser hendler ^rhost dormouse) ; host dormouse (make user ^user root ^password unknown ^host dormouse) (make user ^user sysdiag ^password none ^host dormouse) (make user ^user hendler ^password unknown ^host dormouse) (make rhosts ^user hendler ^host dormouse ^ruser hendler ^rhost mimsy)