~ chicken-core (chicken-5) 86c9a72d6034efa9389b074ba970d2521761fb3e
commit 86c9a72d6034efa9389b074ba970d2521761fb3e
Author: Evan Hanson <evhan@foldling.org>
AuthorDate: Mon Jul 23 11:20:05 2018 +1200
Commit: Kooda <kooda@upyum.com>
CommitDate: Fri Jul 27 09:47:08 2018 +0200
Handle exceptions from `terminal-size' in chicken-status
This fixes chicken-status on the MinGW platform where `terminal-size'
will raise a (previously unhandled) exception.
Signed-off-by: Kooda <kooda@upyum.com>
diff --git a/chicken-status.scm b/chicken-status.scm
index fd8bd19d..777b6f0d 100644
--- a/chicken-status.scm
+++ b/chicken-status.scm
@@ -27,6 +27,7 @@
(import (scheme)
(chicken base)
+ (chicken condition)
(chicken file)
(chicken file posix)
(chicken fixnum)
@@ -53,7 +54,7 @@
(lambda ()
(let ((cop (current-output-port)))
(if (terminal-port? cop)
- (let ((w (nth-value 1 (terminal-size cop))))
+ (let ((w (handle-exceptions exn 0 (nth-value 1 (terminal-size cop)))))
(if (zero? w)
default-width
(min default-width w)))
Trap