takawiri: resize TOB based on terminal height

FossilOrigin-Name: 51060ca9e94106e2b76d80048444dacffbb98a00660e1a95902327ca9db2f6a8
This commit is contained in:
crc 2024-02-21 19:42:28 +00:00
parent a34c08b74f
commit c6d48d1f0b

View file

@ -11,13 +11,6 @@
# Terminal Configuration # 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 Setup the local terminal dimensions. This requires the current
development build of Retro to gain access to the `ioctl:` words. development build of Retro to gain access to the `ioctl:` words.
(If not using this, hard code the terminal constraints for your (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 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:W #100 lt? [ 'Terminal_too_narrow! s:put nl bye ] if
LT:H #27 lt? [ 'Terminal_too_short! s:put nl bye ] if LT:H #27 lt? [ 'Terminal_too_short! s:put nl bye ] if