[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SuSE 9.1 weirdness resolved
From: |
Dave Ulrick |
Subject: |
Re: SuSE 9.1 weirdness resolved |
Date: |
Tue, 21 Jun 2005 10:24:33 -0500 (CDT) |
On Mon, 20 Jun 2005, Thomas Dickey wrote:
On Mon, 20 Jun 2005, Dave Ulrick wrote:
Conclusion: _don't_ 'export' LINES or COLUMNS, lest strange things happen
to your ncurses apps!
yes - that's something that no one commented on before that I can recall. It
happens that ncurses obtains the screensize in just one function, which is
shared by this (and the _nc_update_screensize function used for SIGWINCH):
The use_env routine, if used, is called before initscr or
newterm are called. When called with FALSE as an argument,
the values of lines and columns specified in the terminfo
database will be used, even if environment variables LINES and
COLUMNS (used by default) are set, or if curses is running in
a window (in which case default behavior would be to use the
window size if LINES and COLUMNS are not set).
and (reading the code now), I see that the adjustment for SIGWINCH would only
happen for the default case (where LINES and COLUMNS would interfere).
SIGWINCH is delivered, but ncurses continues to let the environment override
the computed screensize.
So there's room for improvement. However, SuSE's setting LINES and COLUMNS
is an error (unless they're actually supporting antique termcap
applications that can't get the screensize).
Although my release of SuSE isn't without its flaws, this particular
issue isn't their fault. In fact, I'd put the 'export LINES COLUMNS'
in /etc/bash.bashrc.local some time ago as part of a failed attempt to
allow shell scripts to see the values of those variables. I usually
back off changes that don't do any good, but for some reason I didn't
get around to doing so with this one. Oops!
BTW, my app is working great now. Among the ncurses features it uses are
color, line-drawing characters, mouse support, and window resize support.
Aside from watching my app redraw its screen to fit the window, my
favorite thing to watch is when it changes the color/attribute scheme on
the fly (at the user's request, of course :-)). Although GUIs are "in"
these days, it's possible to write some very powerful and slick apps using
screen libraries such as ncurses.
My thanks go to Thomas and the rest of the ncurses team for an excellent
product.
Dave
--
Dave Ulrick
Email: address@hidden
Web: http://www.niu.edu/~ulrick/