fix: TUI startup — bash script debugger-hook and tangled file regen

This commit is contained in:
2026-05-16 17:43:20 -04:00
parent 7e9da0f867
commit 7eca785b0a

View File

@@ -385,21 +385,24 @@ case "$COMMAND" in
# Build TUI load script with proper paths # Build TUI load script with proper paths
cat > /tmp/tui-load.lisp << LISPEOF cat > /tmp/tui-load.lisp << LISPEOF
(load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))) (load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))
(declaim (optimize (debug 3) (speed 0) (safety 3)))
(push (truename "$PASSEPARTOUT_DATA_DIR/") asdf:*central-registry*) (push (truename "$PASSEPARTOUT_DATA_DIR/") asdf:*central-registry*)
(ql:quickload :cl-tty :silent t) (ql:quickload :cl-tty :silent t)
(ql:quickload :passepartout :silent t) (ql:quickload :passepartout :silent t)
(setf *debugger-hook* nil)
(let ((dir (pathname (format nil "~a/lisp/" (truename "$PASSEPARTOUT_DATA_DIR"))))) (let ((dir (pathname (format nil "~a/lisp/" (truename "$PASSEPARTOUT_DATA_DIR")))))
(dolist (f '("channel-tui-state" "channel-tui-view" "channel-tui-main")) (dolist (f '("channel-tui-state" "channel-tui-view" "channel-tui-main"))
(let* ((src (merge-pathnames (format nil "~a.lisp" f) dir)) (let* ((src (merge-pathnames (format nil "~a.lisp" f) dir))
(fasl (merge-pathnames (format nil "~a.fasl" f) dir))) (fasl (merge-pathnames (format nil "~a.fasl" f) dir)))
(when (or (not (probe-file fasl)) (when (or (not (probe-file fasl))
(< (file-write-date fasl) (file-write-date src))) (< (file-write-date fasl) (file-write-date src)))
(compile-file src :output-file fasl :verbose nil :print nil)) (let ((out (compile-file src :output-file fasl :verbose nil :print nil)))
(load fasl :verbose nil :print nil)))) (unless out
(in-package :passepartout) (format t "~%*** COMPILE FAILED: ~a ***~%" src))))
(let ((r (load fasl :verbose nil :print nil)))
(unless r
(format t "~%*** LOAD FAILED: ~a ***~%" fasl)))))
(handler-case (handler-case
(passepartout.channel-tui:tui-main) (funcall (find-symbol "TUI-MAIN" "PASSEPARTOUT.CHANNEL-TUI"))
(error (c) (error (c)
(ignore-errors (ignore-errors
(with-open-file (f (merge-pathnames ".cache/passepartout/tui-crash.log" (user-homedir-pathname)) (with-open-file (f (merge-pathnames ".cache/passepartout/tui-crash.log" (user-homedir-pathname))
@@ -407,7 +410,7 @@ case "$COMMAND" in
(format f "CRASH: ~a~%~%" c) (sb-debug:print-backtrace :count 50 :stream f) (finish-output f))) (format f "CRASH: ~a~%~%" c) (sb-debug:print-backtrace :count 50 :stream f) (finish-output f)))
(format t "~%=== TUI CRASH ===~%CRASH: ~a~%" c) (format t "~%=== TUI CRASH ===~%CRASH: ~a~%" c)
(format t "Full backtrace saved to ~~/.cache/passepartout/tui-crash.log~%") (format t "Full backtrace saved to ~~/.cache/passepartout/tui-crash.log~%")
(sleep 3) (finish-output))) (sleep 3) (finish-output))))
(uiop:quit 0) (uiop:quit 0)
LISPEOF LISPEOF
# Restore terminal on any exit (set -e can kill the script before the # Restore terminal on any exit (set -e can kill the script before the