From 13b6edab3265b374d2cd518321a8eff1ad8cf8a1 Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Fri, 15 May 2026 16:10:11 -0400 Subject: [PATCH] fix: nil check in CSI detection (= b2 91), Swank *standard-output* redirect - (= b2 91) errors when b2 is nil (read-raw-byte timeout). Add (and b2 (= b2 91)) to guard against nil. - Swank writes ';; Swark started at port:...' to *standard-output*, not *error-output*. Bind *standard-output* to string stream too. --- org/channel-tui-main.org | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/org/channel-tui-main.org b/org/channel-tui-main.org index 24c5093..71ded14 100644 --- a/org/channel-tui-main.org +++ b/org/channel-tui-main.org @@ -886,10 +886,12 @@ Returns T on success, nil on failure. Does NOT wait or retry." (when (> swank-port 0) (handler-case (progn - (ql:quickload :swank :silent t) - (funcall (find-symbol "CREATE-SERVER" "SWANK") - :port swank-port :dont-close t) - (add-msg :system + (ql:quickload :swank :silent t) + (let ((*standard-output* (make-string-output-stream)) + (*error-output* (make-string-output-stream))) + (funcall (find-symbol "CREATE-SERVER" "SWANK") + :port swank-port :dont-close t)) + (add-msg :system (format nil "* Swank ~d M-x slime-connect *" swank-port))) (error () (add-msg :system "* Swank unavailable *")))) @@ -969,7 +971,7 @@ Returns T on success, nil on failure. Does NOT wait or retry." (code b) (esc-seq (and (= code 27) (let ((b2 (cl-tty.input::read-raw-byte :timeout 0.15))) - (when (= b2 91) + (when (and b2 (= b2 91)) (let ((t2 (cl-tty.input::read-raw-byte :timeout 0.15))) (and t2 (case t2 (65 :up) (66 :down)