浏览代码

Disabled logic for checking resize with ESC sequences

Tig Kindel 2 年之前
父节点
当前提交
2242f38409
共有 1 个文件被更改,包括 47 次插入43 次删除
  1. 47 43
      Terminal.Gui/ConsoleDrivers/NetDriver.cs

+ 47 - 43
Terminal.Gui/ConsoleDrivers/NetDriver.cs

@@ -118,7 +118,8 @@ namespace Terminal.Gui {
 #if PROCESS_REQUEST
 		bool neededProcessRequest;
 #endif
-		public bool IsTerminalWithOptions { get; set; }
+		// BUGBUG: See https://github.com/gui-cs/Terminal.Gui/issues/2745
+		//public bool IsTerminalWithOptions { get; set; }
 		public EscSeqReqProc EscSeqReqProc { get; } = new EscSeqReqProc ();
 
 		public NetEvents (ConsoleDriver consoleDriver)
@@ -227,8 +228,9 @@ namespace Terminal.Gui {
 				if (stopTasks) {
 					return;
 				}
-				switch (IsTerminalWithOptions) {
-				case false:
+				// BUGBUG: See https://github.com/gui-cs/Terminal.Gui/issues/2745
+				//switch (IsTerminalWithOptions) {
+				//case false:
 					int buffHeight, buffWidth;
 					if (((NetDriver)consoleDriver).IsWinPlatform) {
 						buffHeight = Math.Max (Console.BufferHeight, 0);
@@ -245,13 +247,13 @@ namespace Terminal.Gui {
 
 						return;
 					}
-					break;
-				case true:
-					//Request the size of the text area in characters.
-					EscSeqReqProc.Add ("t");
-					Console.Out.Write ("\x1b[18t");
-					break;
-				}
+				//	break;
+				//case true:
+				//	//Request the size of the text area in characters.
+				//	EscSeqReqProc.Add ("t");
+				//	Console.Out.Write ("\x1b[18t");
+				//	break;
+				//}
 			}
 		}
 
@@ -461,36 +463,37 @@ namespace Terminal.Gui {
 					return;
 				}
 				break;
-			case "c":
-				try {
-					var parent = EscSeqUtils.GetParentProcess (Process.GetCurrentProcess ());
-					if (parent == null) { Debug.WriteLine ("Not supported!"); }
-				} catch (Exception ex) {
-					Debug.WriteLine (ex.Message);
-				}
-
-				if (c1Control == "CSI" && values.Length == 2
-					&& values [0] == "1" && values [1] == "0") {
-					// Reports CSI?1;0c ("VT101 with No Options")
-					IsTerminalWithOptions = false;
-				} else {
-					IsTerminalWithOptions = true;
-				}
-				break;
-			case "t":
-				switch (values [0]) {
-				case "8":
-					IsWinChanged (
-						Math.Max (int.Parse (values [1]), 0),
-						Math.Max (int.Parse (values [2]), 0),
-						Math.Max (int.Parse (values [1]), 0),
-						Math.Max (int.Parse (values [2]), 0));
-					break;
-				default:
-					SetRequestedEvent (c1Control, code, values, terminating);
-					break;
-				}
-				break;
+			// BUGBUG: See https://github.com/gui-cs/Terminal.Gui/issues/2745
+			//case "c":
+			//	try {
+			//		var parent = EscSeqUtils.GetParentProcess (Process.GetCurrentProcess ());
+			//		if (parent == null) { Debug.WriteLine ("Not supported!"); }
+			//	} catch (Exception ex) {
+			//		Debug.WriteLine (ex.Message);
+			//	}
+
+			//	if (c1Control == "CSI" && values.Length == 2
+			//		&& values [0] == "1" && values [1] == "0") {
+			//		// Reports CSI?1;0c ("VT101 with No Options")
+			//		IsTerminalWithOptions = false;
+			//	} else {
+			//		IsTerminalWithOptions = true;
+			//	}
+			//	break;
+			//case "t":
+			//	switch (values [0]) {
+			//	case "8":
+			//		IsWinChanged (
+			//			Math.Max (int.Parse (values [1]), 0),
+			//			Math.Max (int.Parse (values [2]), 0),
+			//			Math.Max (int.Parse (values [1]), 0),
+			//			Math.Max (int.Parse (values [2]), 0));
+			//		break;
+			//	default:
+			//		SetRequestedEvent (c1Control, code, values, terminating);
+			//		break;
+			//	}
+			//	break;
 			default:
 				SetRequestedEvent (c1Control, code, values, terminating);
 				break;
@@ -1283,9 +1286,10 @@ namespace Terminal.Gui {
 			// Note: Net doesn't support keydown/up events and thus any passed keyDown/UpHandlers will be simulated to be called.
 			mLoop.ProcessInput = (e) => ProcessInput (e);
 
-			// Check if terminal supports requests
-			this.mainLoop.netEvents.EscSeqReqProc.Add ("c");
-			Console.Out.Write ("\x1b[0c");
+			// BUGBUG: See https://github.com/gui-cs/Terminal.Gui/issues/2745
+			//// Check if terminal supports requests
+			//this.mainLoop.netEvents.EscSeqReqProc.Add ("c");
+			//Console.Out.Write ("\x1b[0c");
 		}
 
 		void ProcessInput (NetEvents.InputResult inputEvent)