diff --git a/wip-duuqnd/editor/editor.lisp b/wip-duuqnd/editor/editor.lisp index 66d8da9..8db382a 100644 --- a/wip-duuqnd/editor/editor.lisp +++ b/wip-duuqnd/editor/editor.lisp @@ -11,6 +11,9 @@ (require '#:sb-posix) (defvar *eio*) +(defparameter *slow-mode-p* nil + "Slows down the sending of characters to the terminal to simulate the slow +serial connection the editor normally runs under.") (defclass hybrid-stream (fundamental-stream) ((%input-stream :accessor input-stream :initarg :input-stream) @@ -29,7 +32,10 @@ (sb-posix:file-descriptor (output-stream stream))) (defmethod stream-write-byte ((stream hybrid-stream) integer) - (write-byte integer (output-stream stream))) + (write-byte integer (output-stream stream)) + (when *slow-mode-p* + (force-output stream) + (sleep 10/9600))) (defmethod stream-write-char ((stream hybrid-stream) character) (if (char= character #\Newline)