anchor.diff:    (setf bottom (clamp bottom 0 (terminal-height term)))
     (when (< top bottom)
       (sys.graphics::bitset (* (- bottom top) 16) (* (terminal-width term) 8)
  -                      #xFF000000 (terminal-framebuffer term)
  -                      (* top 16) 0)))
  +                          #xFF000000 (terminal-framebuffer term)
  +                          (+ (* top 16) (y-offset term)) (x-offset term))))
   
   (defun erase (term left right)
     (setf left (clamp left 0 (terminal-width term)))
  
positive.code:     (when (and (<= 0 x (1- (terminal-width term)))
                 (<= 0 y (1- (terminal-height term))))
        (if (eql char #\Space)
            (sys.graphics::bitset 16 8 #xFF000000 (terminal-framebuffer term) (* y 16) (* x 8))
            (sys.int::render-char-at char (terminal-framebuffer term) (* x 8) (* y 16))))
      (incf (x-pos term))))
  
  (defun clamp (value min max)
  
negative.code:      #+nil(write-sequence (vector +command-iac+ +command-wont+
                                    (read-byte connection))))))
  
  (defun telnet-rx (telnet)
    (handler-case
        (with-simple-restart (abort "Give up")
          (sys.int::process-wait "Awaiting connection" (lambda () (telnet-connection telnet)))
          ;; Announce capabilities.
          (write-sequence #(#.+command-iac+ #.+command-do+ #.+option-suppress-go-ahead+)
                          (telnet-connection telnet))
          (let ((last-was-cr nil))
            (loop (let ((byte (read-byte (telnet-connection telnet))))
                    (cond ((eql byte +command-iac+)
                           (let ((command (read-byte (telnet-connection telnet))))
                             (if (eql command +command-iac+)
                                 (write-byte +command-iac+ (telnet-terminal telnet))
                                 (telnet-command (telnet-connection telnet) command))))
                          ((eql byte #x0D) ; CR
                           (setf last-was-cr t)
                           (write-byte byte (telnet-terminal telnet)))
                          ((and last-was-cr (eql byte #x00))
                           (setf last-was-cr nil))
                          (t (setf last-was-cr nil)
                             (write-byte byte (telnet-terminal telnet)))))
               (setf sys.graphics::*refresh-required* t))))
      (end-of-file ()
        (let ((msg "Connection closed by remote host."))
          (dotimes (i (length msg))
            (write-byte (char-code (char msg i)) (telnet-terminal telnet))))
        (setf sys.graphics::*refresh-required* t))))
  
  (defun telnet-top-level (window)
    (multiple-value-bind (left right top bottom)
        (sys.graphics::compute-window-margins window)
      (unwind-protect
           (let* ((fb (sys.graphics::window-frontbuffer window))
                  (dims (array-dimensions fb))
                  (terminal (make-instance 'xterm-terminal
                                           :framebuffer fb
                                           :x left
                                           :y top
                                           :width (- (array-dimension (sys.graphics::window-backbuffer window) 1)
                                                     left right)
                                           :height (- (array-dimension (sys.graphics::window-backbuffer window) 0)
                                                      top bottom)
                                           :input window
                                           :interrupt-character (name-char "C-["))))
             (setf (slot-value window 'terminal) terminal)
             (setf sys.graphics::*refresh-required* t)
             ;; Hard-code NAO for now.
             (with-open-stream (connection (sys.net::tcp-stream-connect '(204 236 130 210) 23))
               (setf (telnet-connection window) connection)
               (handler-case
                   (loop (let ((byte (read-byte terminal)))
                           (when (eql byte +command-iac+)
                             (write-byte +command-iac+ connection))
                           (write-byte byte connection)))
                 (terminal-interrupt ()))))
        (sys.graphics::close-window window)
        (sys.int::process-disable (receive-process window)))))
  
  (defclass telnet-client (sys.int::stream-object sys.graphics::window-with-chrome)
    ((command-process :reader command-process)
     (receive-process :reader receive-process)
     (buffer :initarg :buffer :reader window-buffer)
     (connection :initform nil :accessor telnet-connection)
     (terminal :reader telnet-terminal))
    (:default-initargs :buffer (sys.graphics::make-fifo 500 'character)))
  
  (defmethod sys.int::stream-read-char ((stream telnet-client))
  