From 53aa471a51e201452552095c078dfc41b254586b Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Fri, 15 May 2026 09:21:54 -0400 Subject: [PATCH] fix: revert to blocking connect-daemon, daemon connection now reliable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Revert async connect-daemon thread (bt:make-thread unreliable — errors in the thread cause silent failure, no connection, no error message) - Restore blocking connect-daemon before with-terminal (original pattern that was working) - Revert /reconnect to synchronous call - Remove stale async thread code and error messages --- org/channel-tui-main.org | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/org/channel-tui-main.org b/org/channel-tui-main.org index 948dccb..b1d016a 100644 --- a/org/channel-tui-main.org +++ b/org/channel-tui-main.org @@ -437,10 +437,12 @@ Event handlers + daemon I/O + main loop. (add-msg :system "* Goodbye *") (send-daemon (list :type :event :payload '(:action :quit))) (setf (st :running) nil)) - ;; /reconnect — re-establish daemon connection - ((string-equal text "/reconnect") - (disconnect-daemon) - (connect-daemon)) + ;; /reconnect — re-establish daemon connection + ((string-equal text "/reconnect") + (disconnect-daemon) + (add-msg :system "* Reconnecting... *") + (connect-daemon) + (setf (st :dirty) (list t t nil))) ;; Normal message (t (add-msg :user text) @@ -905,8 +907,8 @@ supplied (e.g. \"/\"), pre-fill the select filter with it." (if (typep be 'cl-tty.backend:modern-backend) "modern" "simple") w h)) ;; Initial dirty all to trigger first redraw in loop - (setq w (or (and (numberp w) (> w 0) w) 80) - h (or (and (numberp h) (> h 0) h) 24)) + (setq w (or (and (numberp w) (> w 0) w) 80) + h (or (and (numberp h) (> h 0) h) 24)) (loop while (st :running) do (dolist (ev (drain-queue)) (cond