Dchris
Dchris

Reputation: 3057

Can't see my whole output in terminal

I am running a program in code blocks,i have a very big output and i can't see the start of my output.I scrolled to the top and it goes only to the middle of my output.How can i see the start of my output?

EDIT:Sometimes my output has to be at about 200-300 lines

Upvotes: 0

Views: 2296

Answers (1)

SendETHToThisAddress
SendETHToThisAddress

Reputation: 3704

Set max lines using the GUI

  1. Right-click the title bar or click the upper-left corner of the Command Prompt window and select Properties.

  2. Click the Layout tab.

  3. Under Screen Buffer Size ->Height, type the number you want. The max you can enter is 9999. You may also wish to increase the window size.

    Command Prompt properties

  4. Click OK.

  5. Close and reopen the terminal for the changes to take effect.

Set max lines using a command

You can actually set the max lines to 32766 using a command, as opposed to using the GUI with a max of 9999. The catch is, once the terminal is closed it will reset to whatever max you entered in the GUI. You can set it to the max size by running this command mode con lines=32766. If you also want to set it to the max columns simultaneously use this mode con:cols=140 lines=32766

The default is 901 and 32766 is the max as of the time of posting this answer. You can set it to whatever you want by adjusting the integer values you pass, as long as it's within the bounds, in which case it would give you an error message.

Note: you don't need to restart the console after entering the command, however you won't be able to scroll back and see the output that was previously cut off, it only applies to text output after running the command.

You can run the below code to test the newly set max output lines

powershell for ($i = 40000; $i -gt 0; $i--) { $i }

It will just print a line with each decrementing number, so when you scroll up the output will look like this:

Terminal output numbered lines

Upvotes: 1

Related Questions