fix: Swank stderr leak, CSI detection with progn wrapper

- Swank: bind *error-output* to string stream to prevent 'Swank started
  at port: 4006.' from leaking to terminal on exit
- CSI detection: wrap inner dotimes in (progn ... t) so the and form
  doesn't short-circuit (dotimes returns nil, breaking the chain)
- Add debug add-msg for CSI detection results
This commit is contained in:
2026-05-15 12:40:07 -04:00
parent df33e8d6db
commit cc38e67d7c

View File

@@ -976,17 +976,21 @@ Returns T on success, nil on failure. Does NOT wait or retry."
(return))
(sleep 0.001))
(and b (char= b #\[)
(dotimes (_ 10)
(when (listen *standard-input*)
(setq t2 (read-char *standard-input* nil nil))
(return))
(sleep 0.001))
(progn
(dotimes (_ 15)
(when (listen *standard-input*)
(setq t2 (read-char *standard-input* nil nil))
(return))
(sleep 0.001))
t)
(case (and t2 (char-code t2))
(65 :up) (66 :down)
(67 :right) (68 :left)
(72 :home) (70 :end)
(otherwise :escape)))))))
(when raw-ch
(when esc-seq
(add-msg :system (format nil "* CSI: ~s *" esc-seq)))
(queue-event
(list :type :key
:payload (list :code code