Nov 09, 2013; 20:23
jolle
Grabbing terminal window columns and lines values
Is there a way for Lasso from inside a script executed on the command line to find out the Terminal windows columns and lines values?
On the command line I can do
tput cols
tput lines
And it would return, for example
95
62
But when I run the same commands from inside a script using sys_process the command will fail with an error:
tput: No value for $TERM and no -T specified
I take it this is because lassos sys_process does not run inside a shell. Setting the -T flag, as suggested in the error will not help since it will then return the default for the terminal type specified, not the real values. In the above case I get
80
24
The values are supposedly also available in the vars
$COLUMNS
$LINES
But I don't know how to access that from inside a script. Also on my machine they return funky values:
-bash: 95: command not found
-bash: 62: command not found
And, yes, this is a Rosetta task where I'm aiming on placing the cursor at the bottom right corner. In order to do that I need to know the number of lines and columns.
HDB
Jolle
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>