}
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;
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)
{