anchor.diff:          (t (let ((ch (read-char (slot-value stream 'input))))
                (when (eql ch (interrupt-character stream))
                  (signal 'terminal-interrupt))
  -             (logand (char-code ch) #xFF)))))
  +             (cond ((logtest (system:char-bits ch)
  +                             (logior sys.int::+char-meta-bit+
  +                                     sys.int::+char-super-bit+
  +                                     sys.int::+char-hyper-bit+))
  +                    ;; Ignore weird characters.
  +                    (stream-read-byte stream))
  +                   ((logtest (system:char-bits ch) sys.int::+char-control-bit+)
  +                    ;; Control character. Translate to ASCII.
  +                    (if (<= #x40 (char-code ch) #x7E)
  +                        (logxor (logand (char-code ch) #b01011111) #b00100000)
  +                        (stream-read-byte stream)))
  +                   (t ;; TODO: UTF-8 translation, etc.
  +                    (let ((translated (assoc ch *xterm-translations*)))
  +                      (cond (translated
  +                             (dolist (c (rest (second translated)))
  +                               (push (char-code c) (slot-value stream 'queued-bytes)))
  +                             (char-code (first (second translated))))
  +                            (t (logand (char-code ch) #xFF))))))))))
   
   (defun read-subnegotiation (connection)
     (let ((bytes (make-array 8 :element-type '(unsigned-byte 8)
  
positive.code:                 (#\d
                   (setf (y-pos stream) (1- (or (first (slot-value stream 'parameters)) 1)))
                   (finish-parsing-escape stream))
                  (#\m (finish-parsing-escape stream)) ; set resource values. **
                  (#\r (finish-parsing-escape stream)) ; set scroll region. **
                  (t (give-up-parsing-escape stream))))))
      (:saw-paren
       ;; Saw "\e(", expecting a character set identifier. **
       (push byte (slot-value stream 'escape-sequence))
       (finish-parsing-escape stream))))
  
  (defmethod sys.int::stream-read-byte ((stream xterm-terminal))
    (cond ((slot-value stream 'queued-bytes)
  
negative.code:      (case (code-char byte)
         (#\[ (setf (terminal-state stream) :saw-bracket))
         (#\( (setf (terminal-state stream) :saw-paren))
         (#\> (finish-parsing-escape stream))
         (#\= (finish-parsing-escape stream))
         (#\M (finish-parsing-escape stream)) ; Reverse index?
         (t (give-up-parsing-escape stream))))
      (:saw-bracket ;; Saw "\e[" and maybe some digits and semicolons.
       (push byte (slot-value stream 'escape-sequence))
  