Description
I was looking at doing something slightly more involved with the Console
class than my occasional calls to WriteLine
or ReadKey
. I began to look at some other properties and methods I hadn't used previously to understand how they should be used and noticed that many did not seem to work as documented.
To give an example, the LargestWindowHeight
property, which supposedly should return the height of the largest possible console window measured in rows. However, that didn't seem to be the case in my tests where it returned a larger number. Or some samples in the documentation that didn't do what they claimed to do.
- https://learn.microsoft.com/en-us/dotnet/api/system.console.setbuffersize?view=net-9.0#examples
- https://learn.microsoft.com/en-us/dotnet/api/system.console.setwindowsize?view=net-9.0#examples
It then occurred to me that perhaps this might be related to the use of the Windows Terminal and after switching to the Windows Console Host, things began to make a little more sense.
Of course, it would be desirable for all Console
features to be available in Windows Terminal given that it is now the default. I also imagine that I'm not the first person to have noticed this and that there's some technical hurdle to make them work. However, I'm a little surprised that the documentation and samples do not reflect any of this. At the very least, they should indicate which methods or properties are not supported.