From 149b489c913502eca50c13b10a81b0ec45f6e85e Mon Sep 17 00:00:00 2001 From: Kevin Bost Date: Sun, 2 Oct 2022 17:36:22 -0700 Subject: [PATCH] When an explicit max width is specified don't override with the terminal's width --- src/System.CommandLine/CommandLineConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.CommandLine/CommandLineConfiguration.cs b/src/System.CommandLine/CommandLineConfiguration.cs index 4da27d7dad..44672ea41b 100644 --- a/src/System.CommandLine/CommandLineConfiguration.cs +++ b/src/System.CommandLine/CommandLineConfiguration.cs @@ -55,7 +55,7 @@ public CommandLineConfiguration( internal static HelpBuilder DefaultHelpBuilderFactory(BindingContext context, int? requestedMaxWidth = null) { int maxWidth = requestedMaxWidth ?? int.MaxValue; - if (context.Console is SystemConsole systemConsole) + if (requestedMaxWidth is null && context.Console is SystemConsole systemConsole) { maxWidth = systemConsole.GetWindowWidth(); }