Size of the terminal with curses
Hey,
How can I get the size of the terminal (in lines and cols) of the actual terminal ? It would be cool if the solution uses some curses function.
Thx
On Wed, 2004-10-20 22:11:23 +0200, Tyler <[email protected]> wrote in message <[email protected]>:
Quoted 2 lines
How can I get the size of the terminal (in lines and cols) of the actual terminal ? It would be cool if the solution uses some curses function.
It's LINES and COLS, see <curses.h>.
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Hi,
Calling ioctl with TIOCGWINSZ, would be another soulution... (tty_ioctl(4)). However I am no expert, please correct me if the above doesn't work with curses.
Andrei
Quoted 7 lines · Jan-Benedict Glaw
On Wed, 2004-10-20 22:11:23 +0200, Tyler <[email protected]> wrote in message <[email protected]>:
Quoted 2 lines
How can I get the size of the terminal (in lines and cols) of the actual terminal ? It would be cool if the solution uses some curses function.
It's LINES and COLS, see <
curses.h>.
Quoted 10 lines
MfG, JBG
--
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ Ofuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret =do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Tyler
How can I get the size of the terminal (in lines and cols) of the actual terminal ? It would be cool if the solution uses some curses function.
Get the values of the 'LINES' and 'COLUMNS' env variables using getenv().
hello
Quoted 3 lines · Tyler
Hey,
How can I get the size of the terminal (in lines and cols) of the actual terminal ? It would be cool if the solution uses some curses function.
nothing to do with ncurses... juste use LINES and COLS macro...
simon