diff --git a/lisp/gateway-tui.lisp b/lisp/gateway-tui.lisp index d14d9b3..36dcec0 100644 --- a/lisp/gateway-tui.lisp +++ b/lisp/gateway-tui.lisp @@ -3,6 +3,8 @@ (:export :tui-main)) (in-package :passepartout.gateway-tui) +(declaim (optimize (debug 3) (safety 3) (speed 0))) + (defvar *stream* nil "TCP stream to daemon") (defvar *input-buffer* nil "Current input line as reversed char list") (defvar *input-history* nil "Sent messages (newest first)") @@ -126,8 +128,8 @@ (text (cdr entry)) (prefix (if (eq dir :sent) "⬆" "⬇")) (label (format nil "~a [~a] ~a" prefix (timestamp) text))) - (add-string win label :y 1 :x y) - (incf y)))))) + (add-string win label :y y :x 1) + (incf y)))))) (refresh win)) (defun input-render (win) @@ -318,12 +320,12 @@ (config-render-cascade config-win)) ((eql ch #\3) (config-render-models config-win)) - ((eql ch #\4) - (config-render-view config-win)))) - (status-render status-win)) - ;; Chat mode key handling - (t - (cond + ((eql ch #\4) + (config-render-view config-win))) + (status-render status-win)) + ;; Chat mode key handling + (t + (cond ;; Enter/Return submit ((or (eql ch 10) (eql ch 13) (eq ch :enter) (eql ch #\Newline) (eql ch #\Return)) (setf *chat-scroll-pos* 0) @@ -367,7 +369,7 @@ (let ((converted (code-char ch))) (when (and converted (graphic-char-p converted)) (push converted *input-buffer*) - (input-render input-win)))))))) + (input-render input-win))))))))) (refresh scr) (sleep 0.01)) (disconnect-daemon)))) diff --git a/org/gateway-tui.org b/org/gateway-tui.org index 302bc25..2acaf75 100644 --- a/org/gateway-tui.org +++ b/org/gateway-tui.org @@ -28,6 +28,8 @@ The TUI Client is a Croatoan-based ncurses chat interface for Passepartout. It c (:export :tui-main)) (in-package :passepartout.gateway-tui) +(declaim (optimize (debug 3) (safety 3) (speed 0))) + (defvar *stream* nil "TCP stream to daemon") (defvar *input-buffer* nil "Current input line as reversed char list") (defvar *input-history* nil "Sent messages (newest first)") @@ -163,8 +165,8 @@ The TUI Client is a Croatoan-based ncurses chat interface for Passepartout. It c (text (cdr entry)) (prefix (if (eq dir :sent) "⬆" "⬇")) (label (format nil "~a [~a] ~a" prefix (timestamp) text))) - (add-string win label :y 1 :x y) - (incf y)))))) + (add-string win label :y y :x 1) + (incf y)))))) (refresh win)) (defun input-render (win) @@ -364,12 +366,12 @@ The TUI Client is a Croatoan-based ncurses chat interface for Passepartout. It c (config-render-cascade config-win)) ((eql ch #\3) (config-render-models config-win)) - ((eql ch #\4) - (config-render-view config-win)))) - (status-render status-win)) - ;; Chat mode key handling - (t - (cond + ((eql ch #\4) + (config-render-view config-win))) + (status-render status-win)) + ;; Chat mode key handling + (t + (cond ;; Enter/Return submit ((or (eql ch 10) (eql ch 13) (eq ch :enter) (eql ch #\Newline) (eql ch #\Return)) (setf *chat-scroll-pos* 0) @@ -413,7 +415,7 @@ The TUI Client is a Croatoan-based ncurses chat interface for Passepartout. It c (let ((converted (code-char ch))) (when (and converted (graphic-char-p converted)) (push converted *input-buffer*) - (input-render input-win)))))))) + (input-render input-win))))))))) (refresh scr) (sleep 0.01)) (disconnect-daemon)))) diff --git a/passepartout b/passepartout index 5883ee8..d05bd74 100755 --- a/passepartout +++ b/passepartout @@ -372,12 +372,13 @@ case "$COMMAND" in fi exec sbcl \ --eval '(load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))' \ + --eval '(declaim (optimize (debug 3) (speed 0) (safety 3)))' \ --eval "(push (truename \"$PASSEPARTOUT_DATA_DIR/\") asdf:*central-registry*)" \ --eval '(ql:quickload :passepartout/tui :force t)' \ --eval '(in-package :passepartout)' \ --eval "(load (format nil \"~alisp/system-model-provider.lisp\" (truename \"$PASSEPARTOUT_DATA_DIR/\")))" \ --eval "(load (format nil \"~alisp/system-model-explorer.lisp\" (truename \"$PASSEPARTOUT_DATA_DIR/\")))" \ - --eval '(handler-bind ((undefined-function (lambda (c) (format t "~%Undefined function: ~a~%" (cell-error-name c)) (sb-debug:print-backtrace :count 20) (finish-output) (uiop:quit 1)))) (passepartout.gateway-tui:tui-main))' + --eval '(handler-bind ((error (lambda (c) (format t "~%CRASH: ~a~%" c) (sb-debug:print-backtrace :count 30 :stream *error-output*) (finish-output) (finish-output *error-output*) (uiop:quit 1)))) (passepartout.gateway-tui:tui-main))' ;; gateway) SUBCMD=$1; PLATFORM=$2; TOKEN=$3