aboutsummaryrefslogtreecommitdiff
path: root/module/output/terminal.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-23 22:51:47 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-23 22:51:47 +0200
commitc9b516afd587050f3424149cfe226f0945378a34 (patch)
tree24d8c6e8a4cb0c8b4d012d4edeae6a13c516d36f /module/output/terminal.scm
parentChange how branch length is calculated. (diff)
downloadcalp-c9b516afd587050f3424149cfe226f0945378a34.tar.gz
calp-c9b516afd587050f3424149cfe226f0945378a34.tar.xz
Get terminal size of terminal output.
Diffstat (limited to 'module/output/terminal.scm')
-rw-r--r--module/output/terminal.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/module/output/terminal.scm b/module/output/terminal.scm
index f9796d68..ebe1e483 100644
--- a/module/output/terminal.scm
+++ b/module/output/terminal.scm
@@ -48,6 +48,11 @@
(define (main-loop time event-stream)
(define cur-event 0)
+ (define height 0)
+ (define width 0)
+ (let* ((h w (get-terminal-size)))
+ (set! height h
+ width w))
(while #t
(let ((events
@@ -73,7 +78,7 @@
(time->string (attr ev 'DTEND) "~1 ~3")
(flow-text (or (attr ev 'DESCRIPTION) "")
#:width 70
- #:height 10))))
+ #:height (- height 8 2 (length events) 5)))))
(let ((char (read-char)))
;; (format (current-error-port)