命令窗口中的更多行

是否有可能将“更多”行放入命令窗口(控制台) ?

当我调试我的程序,我输出了相当多的行到窗口和输出的开始不断消失的范围,我可以向后滚动窗口,所以我没有看到我的完整输出从程序的开始。

如何让命令窗口保持所有行?

(是的,我也可以将它作为日志写入文本文件,但我想改变一下,尝试这样做)

108203 次浏览

If you're using windows , click on the CMD icon in the top left corner and go to properties.

Click the Options tab.

In Command History, type or select 999 in Buffer Size, and then type or select 5 in Number of Buffers.

At least in Win7, Kristina's answer now seems to be either its memory of commands typed in the command lines, or the amount you can copy-paste.

To increase the scrollbar's memory, I did the following:

  • Go to properties as mentioned by Kristina
  • Go to the layout tab (that's the third one)
  • Modify the screen buffer size's height - 9999 is the maximum.

As mentioned by Joey in the comments to Kristina's answer, this will not work on things you've already done - only on things you do after making the change.

This answer was originally written when Kristina's was marked as accepted. Now that this is the accepted answer, I've edited my answer to avoid confusion.

Just to complement the answer(s) above, its also possible to export the lines to a txt file using > fileName.txt

For example:

myProgram.exe > output.txt // will create a new file with all the output of myProgram