Unhandled Exception: System.NotSupportedException: Operation is not supported.
Ubuntu 11.10 を使用すると、Mono で例外が発生します。
プロパティの読み取りは機能します。ドキュメントは、メソッドが問題を引き起こさないことを示唆している可能性があります。
この状況を最もよく処理または修正する方法についてのアイデアはありますか?
私の現在の解決策はかなりぎこちなく、System.Console-API を介してウィンドウ サイズを設定する問題を解決しません。
const int defaultConsoleWindowWidth = 80;
const int defaultConsoleWindowHeight = 25;
if (pid != PlatformID.Unix && pid != (PlatformID)128) {
System.Console.WindowHeight = lastConsoleWindowHeight;
System.Console.WindowWidth = defaultConsoleWindowWidth;
}else{
//assume *NIX system
try {
var p = new Process();
p.StartInfo = new ProcessStartInfo(@"stty cols " + defaultConsoleWindowWidth + " rows " + lastConsoleWindowHeight, "-n")
{
UseShellExecute = false
};
p.Start();
p.WaitForExit();
}
catch (Exception e) { /*...*/}
}
私のモノバージョン:
lo@lo-VirtualBox:~/Desktop$ mono --version
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)