how to determine telnet screen size



I can use tput cols to get the width of a telnet terminal emulator window,
but how can I get the number of rows?

Part two:
How can my application be notified of screen size changes, so it can adjust
accordingly?

Thanks,
Don