PHP : Function Reference : Ncurses Terminal Screen Control Functions : ncurses_getmaxyx
superzouz
After some headscratching as to why my script was not detecting the terminal being resized... i discovered that the function would not report the new size of the terminal until the window is refreshed.
So this is the code that I am using to get the size of the screen:
$fullscreen = ncurses_newwin ( 0, 0, 0, 0);
// everytime you want to find out the size of the screen, write the following 2 lines:
ncurses_wrefresh($fullscreen);
ncurses_getmaxyx ($fullscreen, $y, $x );
|