anchor.diff:       (incf (y-pos terminal)))
       (#\Bs
        (decf (x-pos terminal)))
  -    (t (write-terminal terminal (code-char byte))))
  +    (t (let ((char (ecase (charset terminal)
  +                     (:usascii (code-char byte)) ; No translation.
  +                     (:dec ;; Translate some characters.
  +                      (if (<= #x60 byte #x7E)
  +                          (aref *dec-special-characters-and-line-drawing*
  +                                (- byte #x60))
  +                          (code-char byte))))))
  +         (write-terminal terminal char))))
     nil)
   
   (defun xterm-saw-escape (terminal byte)
  
positive.code:     #xFFFFFF ; 7 Bright White
      ))
  
  (defun set-character-attributes (terminal attributes)
    (when (endp attributes) (setf attributes '(0)))
    (dolist (attr attributes)
      (case attr
        (0 ;; Normal (reset to defaults).
         (setf (bold terminal) nil
               (foreground-colour terminal) #xC0C0C0
               (background-colour terminal) #x000000))
        (1 ;; Bold.
         (setf (bold terminal) t))
        (4 ;; Underlined
         )
        (5 ;; Blink.
         (setf (bold terminal) t))
        (7 ;; Inverse.
         )
        (8 ;; Invisible.
         )
        (22 ;; Not bold.
         (setf (bold terminal) nil))
        (24 ;; Not underlined.
         )
        (25 ;; Not blink.
         )
        (27 ;; Not inverse.
         )
        (28 ;; Not invisible.
         )
        (39 ;; Set foreground to default
         (setf (foreground-colour terminal) #xC0C0C0))
        (49 ;; Set background to default
         (setf (background-colour terminal) #x000000))
        (t (cond
             ((<= 30 attr 37)
              (setf (foreground-colour terminal) (elt *xterm-colours* (- attr 30))))
             ((<= 40 attr 47)
              (setf (background-colour terminal) (elt *xterm-colours* (- attr 40))))
             ((<= 90 attr 97)
              (setf (foreground-colour terminal) (elt *xterm-colours* (+ 8 (- attr 90)))))
             ((<= 100 attr 107)
              (setf (background-colour terminal) (elt *xterm-colours* (+ 8 (- attr 100)))))
             (t (report-unknown-escape terminal)))))))
  
  (defun xterm-initial (terminal byte)
  
negative.code:    (y-pos :initform 0 :accessor y-pos)
     (foreground :initarg :foreground :accessor foreground-colour)
     (background :initarg :background :accessor background-colour)
     (bold :initarg :bold :accessor bold)
     (inverse :initarg :inverse :accessor inverse)
     (underline :initarg :underline :accessor underline)
     (character-set :initarg :charset :accessor charset))
    (:default-initargs
     :interrupt-character nil
     :queued-bytes '()
     :foreground nil
     :background nil
     :bold nil
     :inverse nil
     :underline nil
     :charset :usascii
     :x 0 :y 0))
  
  (defparameter *xterm-colours*
    #(#x000000 ; 0 Black
  