On 5/12/26 12:58 PM, Robert Elz wrote:
So a user (or script) can just dotsize() { set -- $(stty size); rows=$1 cols=$2; } trap tsize WINCH tsize
Scripts could always do this with LINES and COLUMNS. The OG way is to use
something like this:
tsize() { eval `resize -u`; }
trap tsize WINCH
tsize
This is what we all used to use in the earlier X11 days. `resize' gives
you output like
$ resize
COLUMNS=80;
LINES=30;
export COLUMNS LINES;
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
