diff --git a/src/backend/modern.lisp b/src/backend/modern.lisp index 02a7441..d38e494 100644 --- a/src/backend/modern.lisp +++ b/src/backend/modern.lisp @@ -162,12 +162,12 @@ as a fallback when a keyword is not in *named-colors*.") (values)) (defmethod backend-size ((b modern-backend)) - (or ;; stty size with :input :inherit — preserves the parent's fd 0 - ;; (the terminal) so stty can query it via ioctl. + (or ;; stty size with :input :interactive — opens /dev/tty for the + ;; child's stdin so stty can query the terminal via ioctl. (multiple-value-bind (cols rows) (ignore-errors (let* ((out (uiop:run-program '("stty" "size") :output :string - :input :inherit + :input :interactive :ignore-error-status t)) (parts (and out (uiop:split-string (string-trim '(#\newline #\space) out))))) diff --git a/src/backend/simple.lisp b/src/backend/simple.lisp index f67e65d..ecf9399 100644 --- a/src/backend/simple.lisp +++ b/src/backend/simple.lisp @@ -22,11 +22,11 @@ (values)) (defmethod backend-size ((b simple-backend)) - (or ;; stty size with :input :inherit — preserves parent's fd 0. + (or ;; stty size with :input :interactive — opens /dev/tty. (multiple-value-bind (cols rows) (ignore-errors (let* ((out (uiop:run-program '("stty" "size") :output :string - :input :inherit + :input :interactive :ignore-error-status t)) (parts (and out (uiop:split-string (string-trim '(#\newline #\space) out)))))