4.1 Emacs in console mode goes beyond the window size

The variable w32-use-full-screen-buffer controls whether Emacs uses the window size or buffer size to determine the number of lines on screen. Normally the window size is correct, but when running Emacs over some telnet servers, the buffer size needs to be used. Emacs tries to guess the correct value at startup, but if it guesses wrong, you can customize that variable yourself.