14

I've been using Command Prompt in Windows for a while now and only just realized that there are several pages worth of empty lines below the prompt. Why?

26

The "large amount of empty space" is the rows of the screen buffer that have not yet been filled with output.

To change the screen buffer from the default of 300 lines, perform the following steps:

  1. Open command prompt.
  2. Right click the application icon (in the upper left corner)
  3. Click on Properties
  4. Select the Layout tab
  5. Set the Screen Buffer Size, Height to 20.
  6. Click OK

Note: I recommend reverting the buffer size as 20 lines isn't many lines of displayed output.

  • 5
    The screen buffer is the number of rows and columns of command prompt output saved in memory. The window size is how much of the buffer is displayed in the window. – Steven Dec 3 '15 at 15:27
  • 1
    @Jay The area outside the bounds of the currently displayed cmd window that can be viewed using the vertical scroll bar. It is usually used to view previous commands and output that are no longer visible. – DavidPostill Dec 3 '15 at 15:28
  • 21
    Instead of changing it back to the default I recommend to change it to the maximum supported value of 9999 lines. That's no really an issue memory-allocation-wise on computers that have been manufactured in this century and it can be quite helpful when running scripts that produce a lot of output. – Kaiserludi Dec 3 '15 at 16:59
  • 1
    @zpr we can still run into memory issues, but they likely won't be caused by the screen buffer in cmd. – Jacob Raihle Dec 4 '15 at 10:35
  • 2
    This doesn't explain why though. Why does the Windows command window allow the user to scroll to space that hasn't been written to yet? Compare to the Mac OS X Terminal and most Linux terminals, which allow a maximum buffer size but don't allow the user to scroll to areas that haven't been used yet. – Andrew Medico Dec 4 '15 at 12:45
11

I know this is not the why, that has been covered by @steven. If you want to change the screen buffer from within a command prompt or batch file you can make use of the mode command (mode columns, lines). I regularly use this from within the command prompt:

mode 200, 300
  • 3
    That's a cool function! I never seen that before! – Canadian Luke Dec 3 '15 at 23:30
  • 4
    MODE is as old as they get. In DOS, the MODE command allowed you to switch between different character modes supported by the graphics adapter hardware. The choices were very limited. On the IBM PC, the MDA had no options (always 80x25) and CGA had just two (MODE 80 and MODE 40). More advanced adapters later introduced more options, including more than 25 lines. VGA for example had MODE 80,43 which used the shorter CGA character matrix on a denser VGA resolution (350 scan lines instead of 200) to provide an extra 18 lines of text. I think the "height" parameter was added maybe on DOS 3.3? – Euro Micelli Dec 4 '15 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.