Console buffer and screen size were not set
ktodyruik opened this issue · 3 comments
When I first tried the examples, because I have my windows console and buffer size set to different dimensions, the example applications were positioned incorrectly for full screen apps. For example, one example the panel was vertically centered, and was off my screen. Scrollling brought it in to view.
Trying my own console app, I added the following which set the windows console correctly:
private static void Main(string[] args)
{
Console.SetWindowSize(80, 24);
Console.SetBufferSize(80, 24);
// etc...
}Shouldn't this be handled by the console framework when you run the console application?
I think, framework shouldn't do that, because user may want to not modify its currently opened console. Because console app is executed in console and inherits it, it will be odd if app will modify inherited console settings. But it is good idea to add some helper methods to allow programmer make this behaviour easy (if he needs this behaviour), I think )
This was the first thing that I've noticed too. It would be great to automatically save the current BufferHeight/BufferWidth values (and reset them using the AppDomain.ProcessExit event) and then overwrite them so that there is no scrolling:
Console.BufferHeight = Console.WindowHeight;
Console.BufferWidth = Console.WindowWidth;
Yes, it may be nice default behaviour !