fix: TUI startup — bash script debugger-hook and tangled file regen
This commit is contained in:
15
passepartout
15
passepartout
@@ -385,21 +385,24 @@ case "$COMMAND" in
|
||||
# Build TUI load script with proper paths
|
||||
cat > /tmp/tui-load.lisp << LISPEOF
|
||||
(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*)
|
||||
(ql:quickload :cl-tty :silent t)
|
||||
(ql:quickload :passepartout :silent t)
|
||||
(setf *debugger-hook* nil)
|
||||
(let ((dir (pathname (format nil "~a/lisp/" (truename "$PASSEPARTOUT_DATA_DIR")))))
|
||||
(dolist (f '("channel-tui-state" "channel-tui-view" "channel-tui-main"))
|
||||
(let* ((src (merge-pathnames (format nil "~a.lisp" f) dir))
|
||||
(fasl (merge-pathnames (format nil "~a.fasl" f) dir)))
|
||||
(when (or (not (probe-file fasl))
|
||||
(< (file-write-date fasl) (file-write-date src)))
|
||||
(compile-file src :output-file fasl :verbose nil :print nil))
|
||||
(load fasl :verbose nil :print nil))))
|
||||
(in-package :passepartout)
|
||||
(let ((out (compile-file src :output-file fasl :verbose nil :print nil)))
|
||||
(unless out
|
||||
(format t "~%*** COMPILE FAILED: ~a ***~%" src))))
|
||||
(let ((r (load fasl :verbose nil :print nil)))
|
||||
(unless r
|
||||
(format t "~%*** LOAD FAILED: ~a ***~%" fasl)))))
|
||||
(handler-case
|
||||
(passepartout.channel-tui:tui-main)
|
||||
(funcall (find-symbol "TUI-MAIN" "PASSEPARTOUT.CHANNEL-TUI"))
|
||||
(error (c)
|
||||
(ignore-errors
|
||||
(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 t "~%=== TUI CRASH ===~%CRASH: ~a~%" c)
|
||||
(format t "Full backtrace saved to ~~/.cache/passepartout/tui-crash.log~%")
|
||||
(sleep 3) (finish-output)))
|
||||
(sleep 3) (finish-output))))
|
||||
(uiop:quit 0)
|
||||
LISPEOF
|
||||
# Restore terminal on any exit (set -e can kill the script before the
|
||||
|
||||
Reference in New Issue
Block a user