[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining term size after SIGWINCH?

From: Thomas Dickey
Subject: Re: Determining term size after SIGWINCH?
Date: Fri, 15 Mar 2002 17:03:19 -0500
User-agent: Mutt/1.2.5i

On Fri, Mar 15, 2002 at 02:51:35PM -0700, NoOne wrote:
> Hi,
> I hope this isn't an FAQ - I've looked through the ncurses docs and can't
> find an answer...
> I'm writing an app which has multiple ncurses windows on screen (not
> subwindows) and I want the app to redraw itself to fill the terminal
> properly after resizing.
> I can catch the SIGWINCH just fine, but then how do I (platform
> independently) determine the new size of the term? The LINES and COLS
> variables don't update, so I'm considering trying to query the client

If you use ncurses' SIGWINCH handler, LINES and COLS will be updated.
In that case, all you have to do is check the result of wgetch() for
KEY_RESIZE and use that to control when you do additional repainting.

See test/view.c for an example with/without ncurses SIGWINCH handler.

> directly via a telnet NAWS request to get the new size. This would work
> over a net connection, but not for Linux consoles or consoles on other
> OSes.
> Is there a better way to go about this? Is there an ncurses call I'm
> missing?
> Thanks,
> -Russ Magee
>  address@hidden
> (Remove underscores to reply)
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-ncurses

Thomas E. Dickey <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]