fix: add / env var fallback in backend-size
ioctl on stdout's fd can disagree with the real terminal size when the process is started with stdout redirected or in some terminal multiplexer configurations. / are set by every POSIX shell at process start and reflect the actual terminal dimensions. Priority: ioctl → env vars → 80x24 fallback. This covers both initial sizing and dynamic SIGWINCH-driven resize.
This commit is contained in:
@@ -39,6 +39,13 @@
|
||||
(values (sb-alien:deref winsize 1)
|
||||
(sb-alien:deref winsize 0)))
|
||||
(sb-alien:free-alien winsize))))
|
||||
(ignore-errors
|
||||
(let ((cols (parse-integer (sb-ext:posix-getenv "COLUMNS")
|
||||
:junk-allowed t))
|
||||
(rows (parse-integer (sb-ext:posix-getenv "LINES")
|
||||
:junk-allowed t)))
|
||||
(when (and cols rows (> cols 0) (> rows 0))
|
||||
(values cols rows))))
|
||||
(values 80 24)))
|
||||
|
||||
(defmethod backend-write ((b simple-backend) string)
|
||||
|
||||
Reference in New Issue
Block a user