How to use Console.SetWindowSize(); on Linux using .Net Core?

懵懂的女人 提交于 2020-12-26 10:33:58

问题


I'm currently working on some fancy console app. I'm using .Net Core 2.1. It was all fine, when I was working on Windows, but then I wanted to test it on Linux and use that glorious "cross-platform". To be specyfic I was using that:

System.Console.SetWindowSize();

And them...

Exception has occurred: CLR/System.PlatformNotSupportedException An unhandled exception of type 'System.PlatformNotSupportedException' occurred in System.Console.dll: 'Operation is not supported on this platform.' at System.ConsolePal.SetWindowSize(Int32 width, Int32 height)

So... Yeah System.PlatformNotSupportedException. Not so "cross-platform". But I was using some win console API etc. My question is:

Is there any workaround or some 3rd party lib, which will work on Linux? Or maybe I'm should use in diffrent?

来源:https://stackoverflow.com/questions/53894813/how-to-use-console-setwindowsize-on-linux-using-net-core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!