Re: Addressing the cursor of a VT100 style terminal emulator using perl



Samwyse <samwyse@xxxxxxxxx> wrote:
>> don't see where that queries the current terminal size. Ditto for
>> Term::ANSIColor.

> Actually, when a terminal is resized, your app gets a SIGWINCH signal.
> You should then issue an ioctl to get the new size:
> struct winsize size;
> ioctl(fileno(stdout), TIOCGWINSZ, &size);
> This way, you don't have to query the terminal and worry about the user
> hitting a key at the wrong time. The ncurses library handles all of
> this for you, I suppose that Term::Cap does as well. The next time you

I don't belive Term::Cap does this since it doesn't have a getch() method.
(likewise Term::AnsiColor).

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
.


Quantcast