fix: use :input :interactive for stty size subprocess

:input :interactive opens /dev/tty for the child's stdin, giving
stty access to the real terminal for its ioctl query.
This commit is contained in:
2026-05-14 14:44:15 -04:00
parent eedf065e6e
commit aa73171c30
2 changed files with 5 additions and 5 deletions

View File

@@ -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)))))

View File

@@ -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)))))