Skip to content

Commit f77719b

Browse files
authored
Merge pull request #279 from Oddley/user/Oddley/fixMonoConsoleWidthSupport
Fixing DisplayWidth for newer Mono
2 parents d391c0c + a9263c2 commit f77719b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: src/CommandLine/ParserSettings.cs

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public ParserSettings()
3535
try
3636
{
3737
maximumDisplayWidth = Console.WindowWidth;
38+
if (maximumDisplayWidth < 1)
39+
{
40+
maximumDisplayWidth = DefaultMaximumLength;
41+
}
3842
}
3943
catch (IOException)
4044
{

Diff for: src/CommandLine/Text/HelpText.cs

+4
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ public HelpText(SentenceBuilder sentenceBuilder, string heading, string copyrigh
105105
try
106106
{
107107
maximumDisplayWidth = Console.WindowWidth;
108+
if (maximumDisplayWidth < 1)
109+
{
110+
maximumDisplayWidth = DefaultMaximumLength;
111+
}
108112
}
109113
catch (IOException)
110114
{

0 commit comments

Comments
 (0)