anchor.diff:  
   (in-package :lisp-chat-client)
   
  +(defvar *io-mutex* (sb-thread:make-mutex :name "io mutex"))
   
   (defun erase-last-line ()
     (format t "~C[1A~C[2K" #\Esc #\Esc))
  
positive.code:   (prog1 (cl-readline:readline :prompt (format nil "[~A]: " username)
                                 :erase-empty-line t
                                 :add-history t)
           (erase-last-line)))
  
  
  (defun send-message (message socket)
  
negative.code: ;; before print a new message, and restore again. Maybe there is a
  ;; better way for doing that.
  (defun receive-message (message)
    (sb-thread:with-mutex (*io-mutex*)
      (let ((line cl-readline:*line-buffer*)
            (prompt cl-readline:+prompt+))
        ;; erase
        (cl-readline:replace-line "" nil)
        (cl-readline:set-prompt "")
        (cl-readline:redisplay)
        ;; print message from server
        (write-line message)
        ;; restore
        (cl-readline:replace-line line nil)
        (setq cl-readline:*point* cl-readline:+end+)
        (cl-readline:set-prompt prompt)
        (cl-readline:redisplay))))
  
  (defun client-sender (socket username)
    (loop for message = (get-user-input username)
  