[comp.mail.elm] Using $LINES before using stty's rows

jbn35564@uxa.cso.uiuc.edu (J.B. Nicholson) (03/16/91)

Why does ELM use $LINES (if $LINES is set to anything) before checking stty's
rows setting when determining the the number of lines on a display?

I'm using KSH, and according to some people I've talked to, the use of $LINES
and $COLUMNS is a "hack" in KSH, and should be avoided.  Also, since I am
trying to get everything to use the same screen settings, I prefer to set
stty with some value and know that every program will check the stty settings
before using some variable like $LINES.

Jeff
--
+----------------------------------------------------------------------------+
| "If you hear an onion ring - answer it."                    J.B. Nicholson |
+----------------------------------------------------------------------------+
| jeffo@uiuc.edu (Internet)              These opinions are mine, that's all.|
+----------------------------------------------------------------------------+

syd@DSI.COM (Syd Weinstein) (03/16/91)

jbn35564@uxa.cso.uiuc.edu (J.B. Nicholson) writes:
>Why does ELM use $LINES (if $LINES is set to anything) before checking stty's
>rows setting when determining the the number of lines on a display?
Because the stty settings are often un-reliable.  First off under
System V they are even unavailable (Lets not talk about Vr4 with
the BSD merged code).  In many systems they don't return the current
size of the window, thus we allow a method of overriding them,
and that is by the LINES and COLUMNS variables.

Most systems don't set LINES and COLUMNS at all and Elm uses the stty
parameters.  If lines and columns variables are unreliable, wrap elm
in a shell script that clears those variables.
-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.                          Voice: (215) 947-9900
syd@DSI.COM or dsinc!syd                        FAX:   (215) 938-0235