[Tizen] Patch for an exception on clearline() accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.093326 accepted/tizen/unified/20230808.074053 tizen_8.0_m2_release
authorHyungju Lee <leee.lee@samsung.com>
Wed, 2 Aug 2023 06:00:14 +0000 (15:00 +0900)
committer이형주/MDE Lab(SR)/삼성전자 <leee.lee@samsung.com>
Mon, 7 Aug 2023 10:35:48 +0000 (19:35 +0900)
src/Microsoft.Diagnostics.Repl/ConsoleService.cs

index 7145a79af3dd2aeefa957ca8a3cf211351ed25a8..5d49805c2300b0e8d0a11c00018676cb511c3cfb 100644 (file)
@@ -269,7 +269,8 @@ namespace Microsoft.Diagnostics.Repl
             }
 
             if (m_clearLine == null || m_clearLine.Length != Console.WindowWidth) {
-                m_clearLine = "\r" + new string(' ', Console.WindowWidth - 1);
+                int consoleWidth = Console.WindowWidth > 0 ? Console.WindowWidth : 1;
+                m_clearLine = "\r" + new string(' ', consoleWidth - 1);
             }
 
             Console.Write(m_clearLine);