[Tizen] Patch for console output not redirected but window width is 0
authorHyungju Lee <leee.lee@samsung.com>
Wed, 2 Aug 2023 04:01:27 +0000 (13:01 +0900)
committerMikhail Kurinnoi <m.kurinnoi@samsung.com>
Tue, 19 Nov 2024 14:47:37 +0000 (17:47 +0300)
src/Tools/Common/Commands/ProcessStatus.cs

index 524dc15cb7404aef80953cebee579af3aaba1e46..1ed05db6afdd22d511ad502b3f45b85e8dfe81c5 100644 (file)
@@ -87,7 +87,7 @@ namespace Microsoft.Internal.Common.Commands
                 }
                 else
                 {
-                    consoleWidth = Console.WindowWidth;
+                    consoleWidth = Console.WindowWidth > 0 ? Console.WindowWidth : Int32.MaxValue;
                 }
                 int extra = (int)Math.Ceiling(consoleWidth * 0.05);
                 int largeLength = consoleWidth / 2 - 16 - extra;
@@ -108,7 +108,7 @@ namespace Microsoft.Internal.Common.Commands
                 int iDLength = GetColumnWidth(processIDs);
                 int nameLength = GetColumnWidth(processNames);
                 int fileLength = GetColumnWidth(fileNames);
-                int cmdLength = GetColumnWidth(commandLineArgs);
+                int cmdLength = Math.Min(GetColumnWidth(commandLineArgs), 128);
 
                 foreach (ProcessDetails info in rows)
                 {