[TerminfoDriver] be more tolerant to failures, and fallback gracefully, instead of...
authorMiguel de Icaza <miguel@gnome.org>
Fri, 25 Feb 2011 04:59:53 +0000 (23:59 -0500)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 25 Feb 2011 05:00:29 +0000 (00:00 -0500)
mcs/class/corlib/System/TermInfoDriver.cs

index aed1571b52fc191670930ddaa5e6fdb256082944..8412c4fc30b6edcc7c9af14ad99d3315d73f3a37 100644 (file)
@@ -212,8 +212,11 @@ namespace System {
                                        endString += resetColors;
                                
                                unsafe {
-                                       if (!ConsoleDriver.TtySetup (keypadXmit, endString, out control_characters, out native_terminal_size))
-                                               throw new IOException ("Error initializing terminal.");
+                                       if (!ConsoleDriver.TtySetup (keypadXmit, endString, out control_characters, out native_terminal_size)){
+                                               control_characters = new byte [17];
+                                               native_terminal_size = -1;
+                                               //throw new IOException ("Error initializing terminal.");
+                                       }
                                }
                                
                                stdin = new StreamReader (Console.OpenStandardInput (0), Console.InputEncoding);
@@ -247,7 +250,7 @@ namespace System {
                                
                                GetCursorPosition ();
 #if DEBUG
-                                       logger.WriteLine ("noGetPosition: {0} left: {1} top: {2}", noGetPosition, cursorLeft, cursorTop);
+                               logger.WriteLine ("noGetPosition: {0} left: {1} top: {2}", noGetPosition, cursorLeft, cursorTop);
                                logger.Flush ();
 #endif
                                if (noGetPosition) {