[Tizen] Patch for console output not redirected but window width is 0 accepted/tizen/unified/20230803.034116
authorHyungju Lee <leee.lee@samsung.com>
Wed, 2 Aug 2023 04:01:27 +0000 (13:01 +0900)
committer이형주/MDE Lab(SR)/삼성전자 <leee.lee@samsung.com>
Wed, 2 Aug 2023 04:50:53 +0000 (13:50 +0900)
src/Tools/Common/Commands/ProcessStatus.cs

index 9a83d7c71aea529589a8984007368e45c5305653..270ff040b91245e3d676932a53d10a0c202f62f9 100644 (file)
@@ -88,7 +88,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;
@@ -109,7 +109,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(var info in rows)
                 {