为什么命令提示符和 Powershell 的底部有这么多空格(回车 returns)?

Why is there so much whitespace (carriage returns) at the bottom of Command Prompt and Powershell?

我一直想知道为什么当您 运行 每个应用程序时,命令提示符和 Powershell 都预加载了这么多回车 returns。你可以永远滚动(好吧,不是真的,但是几十个,如果不是数百页长度的空白 space)。我现在没有我的 Unix 机器,但我很确定终端没有那个填充。

我试过寻找原因,但一无所获。这不完全是一个错误,所以我想没有多少人在寻找答案。

我认为您可能指的是此处所述的屏幕缓冲区大小:https://mcpmag.com/articles/2013/03/12/powershell-screen-buffer-size.aspx?m=1

这篇文章解释得更详细:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx

When a screen buffer is created, it contains blanks. Its cursor is visible and positioned at the buffer's origin (0,0), and the window is positioned with its upper left corner at the buffer's origin. The size of the console screen buffer, the window size, the text attributes, and the appearance of the cursor are determined by the user or by the system defaults.

Unix 的工作方式略有不同,通过回滚缓冲区,如下所述:https://unix.stackexchange.com/questions/145050/what-exactly-is-scrollback-and-scrollback-buffer