From c6d48d1f0ba5f9b8d09efdfdb79d0927700a86da Mon Sep 17 00:00:00 2001 From: crc <> Date: Wed, 21 Feb 2024 19:42:28 +0000 Subject: [PATCH] takawiri: resize TOB based on terminal height FossilOrigin-Name: 51060ca9e94106e2b76d80048444dacffbb98a00660e1a95902327ca9db2f6a8 --- takawiri.retro | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/takawiri.retro b/takawiri.retro index 2292cc1..bad6186 100755 --- a/takawiri.retro +++ b/takawiri.retro @@ -11,13 +11,6 @@ # Terminal Configuration -Setup the text output buffer dimensions. - -~~~ -#80 'TOB:W const -#25 'TOB:H const -~~~ - Setup the local terminal dimensions. This requires the current development build of Retro to gain access to the `ioctl:` words. (If not using this, hard code the terminal constraints for your @@ -27,6 +20,18 @@ system). ioctl:term-size (rows,cols) 'LT:W const 'LT:H const ~~~ +Setup the text output buffer dimensions. The width is currently +fixed at 80 columns; the height is set based on the terminal +height. + +~~~ +#80 'TOB:W const +LT:H #2 - 'TOB:H const +~~~ + +Check to make sure the terminal is large enough to display +everything. + ~~~ LT:W #100 lt? [ 'Terminal_too_narrow! s:put nl bye ] if LT:H #27 lt? [ 'Terminal_too_short! s:put nl bye ] if