Repository: ewels/rich-click (language: python)

Issue:
Rich-Click does not translate the ascii codes into colors on windows 64 cmd.exe anymore
Hi there,

Upgrading from 1.6.1 to 1.7.0 breaks the color output in cmd.exe on windows 64. Running the example 01_simple.py works perfectly with rich-click 1.6.1.

However with rich-click 1.7.3 (the bug appears in 1.7.0 but i tried with the latest version to be sure) the output of 01_simple.py is:
```                                                                                                                                                                
 ←[33mUsage:←[0m ←[1m01_simple.py←[0m [←[1;36mOPTIONS←[0m] ←[1;36mCOMMAND←[0m [←[1;36mARGS←[0m]...                                                              
                                                                                                                                                                
 My amazing tool does all the things.                                                                                                                           
 ←[2mThis is a minimal example based on documentation from the 'click' package.←[0m                                                                             
 ←[2mYou can try using ←[0m←[1;2;36m-←[0m←[1;2;36m-help←[0m←[2m at the top level and also for specific subcommands.←[0m                                         

```

As  you can the ascii codes are not converted to colors anymore. sobs.

Dump of conda list environment (the problem happens with python pip and venv too):
```
# packages in environment at C:\conda\envs64\richclick173:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                hcfcfb64_5    conda-forge
ca-certificates           2024.2.2             h56e8100_0    conda-forge
click                     8.1.7           win_pyh7428d3b_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
libexpat                  2.6.1                h63175ca_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libsqlite                 3.45.1               hcfcfb64_0    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.2              pyhd8ed1ab_0    conda-forge
openssl                   3.2.1                hcfcfb64_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
pygments                  2.17.2             pyhd8ed1ab_0    conda-forge
python                    3.12.2          h2628c8c_0_cpython    conda-forge
rich                      13.7.1             pyhd8ed1ab_0    conda-forge
rich-click                1.7.3              pyhd8ed1ab_0    conda-forge
setuptools                69.1.1             pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h5226925_1    conda-forge
typing_extensions         4.10.0             pyha770c72_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
vc                        14.3                hcf57466_18    conda-forge
vc14_runtime              14.38.33130         h82b7239_18    conda-forge
vs2015_runtime            14.38.33130         hcb4865c_18    conda-forge
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge

```

hopefully this is a simple fix as the rich click --help are way nicer!

thanks


Discussion / hints:
Interesting! 1.7.0 had a major shift in Rich-Click's internals, and I guess a few things fell under the cracks.

I'm not on Windows, but I think I see what the issue is: In 1.7.0, the config variable `legacy_windows` was added and its default is `False`, whereas its default should probably be `None`.

Can you confirm that the issue is fixed if you run the help text for the following?

```python
import rich_click as click

@click.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
@click.rich_config(help_config=click.RichHelpConfiguration(legacy_windows=None))
def hello(count, name):
    """Simple program that greets NAME for a total of COUNT times."""
    for _ in range(count):
        click.echo(f"Hello, {name}!")

if __name__ == '__main__':
    hello()
```

Note the addition of `@click.rich_config(help_config=click.RichHelpConfiguration(legacy_windows=None))`. I do agree that, since Rich auto-detects this for users, this implies `None` should be the default.
yes! adding:

```
@click.rich_config(help_config=click.RichHelpConfiguration(legacy_windows=None))

```

to all the commands in 01_simple.py fixed it.

Well done!

Fix patch:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 4e1ce06d..eea2b0e2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -22,15 +22,15 @@ repos:
         require_serial: true
         additional_dependencies:
           - isort
-      - id: black
-        name: Black - Auto-formatter.
-        description: Black is the uncompromising Python code formatter. Writing to files.
-        entry: black
-        language: python
-        types: [python]
-        require_serial: true
-        additional_dependencies:
-          - black
+      #      - id: black
+      #        name: Black - Auto-formatter.
+      #        description: Black is the uncompromising Python code formatter. Writing to files.
+      #        entry: black
+      #        language: python
+      #        types: [python]
+      #        require_serial: true
+      #        additional_dependencies:
+      #          - black
       - id: flake8
         name: Flake8 - Enforce code style and doc.
         description: A command-line utility for enforcing style consistency across Python projects.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 057f0b3c..05ea8563 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Changelog: rich-click
 
+## Version 1.7.4
+
+- Set `legacy_windows` by default to `None`, and deprecated this option.
+
 ## Version 1.7.3
 
 - Fix false deprecation warning.
diff --git a/src/rich_click/__init__.py b/src/rich_click/__init__.py
index 62a23a69..18ad2284 100644
--- a/src/rich_click/__init__.py
+++ b/src/rich_click/__init__.py
@@ -6,7 +6,7 @@
 customisation required.
 """
 
-__version__ = "1.7.3"
+__version__ = "1.7.4"
 
 # Import the entire click API here.
 # We need to manually import these instead of `from click import *` to force mypy to recognize a few type annotation overrides for the rich_click decorators.
diff --git a/src/rich_click/rich_help_configuration.py b/src/rich_click/rich_help_configuration.py
index ab0c715a..e011fe18 100644
--- a/src/rich_click/rich_help_configuration.py
+++ b/src/rich_click/rich_help_configuration.py
@@ -145,4 +145,4 @@ class RichHelpConfiguration:
     """Use click's default function to truncate help text"""
     highlighter: rich.highlighter.Highlighter = field(default_factory=lambda: OptionHighlighter())
     """Rich regex highlighter for help highlighting"""
-    legacy_windows: Optional[bool] = field(default=False)
+    legacy_windows: Optional[bool] = field(default=None)


Test patch:
diff --git a/tests/expectations/test_rich_click[test arguments with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test arguments with rich_config]-click7.config.json
index 057a2f89..f61f97c0 100644
--- a/tests/expectations/test_rich_click[test arguments with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test arguments with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test arguments with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test arguments with rich_config]-click8.config.json
index 057a2f89..f61f97c0 100644
--- a/tests/expectations/test_rich_click[test arguments with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test arguments with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test arguments]-click7.config.json b/tests/expectations/test_rich_click[test arguments]-click7.config.json
index 057a2f89..f61f97c0 100644
--- a/tests/expectations/test_rich_click[test arguments]-click7.config.json
+++ b/tests/expectations/test_rich_click[test arguments]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test arguments]-click8.config.json b/tests/expectations/test_rich_click[test arguments]-click8.config.json
index 057a2f89..f61f97c0 100644
--- a/tests/expectations/test_rich_click[test arguments]-click8.config.json
+++ b/tests/expectations/test_rich_click[test arguments]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test command column alignment]-click7.config.json b/tests/expectations/test_rich_click[test command column alignment]-click7.config.json
index bbd217dd..64c08737 100644
--- a/tests/expectations/test_rich_click[test command column alignment]-click7.config.json
+++ b/tests/expectations/test_rich_click[test command column alignment]-click7.config.json
@@ -114,5 +114,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test command column alignment]-click8.config.json b/tests/expectations/test_rich_click[test command column alignment]-click8.config.json
index bbd217dd..64c08737 100644
--- a/tests/expectations/test_rich_click[test command column alignment]-click8.config.json
+++ b/tests/expectations/test_rich_click[test command column alignment]-click8.config.json
@@ -114,5 +114,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test context_settings]-click7.config.json b/tests/expectations/test_rich_click[test context_settings]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test context_settings]-click7.config.json
+++ b/tests/expectations/test_rich_click[test context_settings]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test context_settings]-click8.config.json b/tests/expectations/test_rich_click[test context_settings]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test context_settings]-click8.config.json
+++ b/tests/expectations/test_rich_click[test context_settings]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test custom errors help]-click7.config.json b/tests/expectations/test_rich_click[test custom errors help]-click7.config.json
index c2d95ebc..bcdd6145 100644
--- a/tests/expectations/test_rich_click[test custom errors help]-click7.config.json
+++ b/tests/expectations/test_rich_click[test custom errors help]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test custom errors help]-click8.config.json b/tests/expectations/test_rich_click[test custom errors help]-click8.config.json
index c2d95ebc..bcdd6145 100644
--- a/tests/expectations/test_rich_click[test custom errors help]-click8.config.json
+++ b/tests/expectations/test_rich_click[test custom errors help]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test custom errors with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test custom errors with rich_config]-click7.config.json
index c2d95ebc..bcdd6145 100644
--- a/tests/expectations/test_rich_click[test custom errors with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test custom errors with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test custom errors with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test custom errors with rich_config]-click8.config.json
index c2d95ebc..bcdd6145 100644
--- a/tests/expectations/test_rich_click[test custom errors with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test custom errors with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test declarative with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test declarative with rich_config]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test declarative with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test declarative with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test declarative with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test declarative with rich_config]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test declarative with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test declarative with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test declarative]-click7.config.json b/tests/expectations/test_rich_click[test declarative]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test declarative]-click7.config.json
+++ b/tests/expectations/test_rich_click[test declarative]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test declarative]-click8.config.json b/tests/expectations/test_rich_click[test declarative]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test declarative]-click8.config.json
+++ b/tests/expectations/test_rich_click[test declarative]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test environment variables with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test environment variables with rich_config]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test environment variables with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test environment variables with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test environment variables with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test environment variables with rich_config]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test environment variables with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test environment variables with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test envvar]-click7.config.json b/tests/expectations/test_rich_click[test envvar]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test envvar]-click7.config.json
+++ b/tests/expectations/test_rich_click[test envvar]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test envvar]-click8.config.json b/tests/expectations/test_rich_click[test envvar]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test envvar]-click8.config.json
+++ b/tests/expectations/test_rich_click[test envvar]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test group sorting]-click7.config.json b/tests/expectations/test_rich_click[test group sorting]-click7.config.json
index 176917e6..5df94216 100644
--- a/tests/expectations/test_rich_click[test group sorting]-click7.config.json
+++ b/tests/expectations/test_rich_click[test group sorting]-click7.config.json
@@ -114,5 +114,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test group sorting]-click8.config.json b/tests/expectations/test_rich_click[test group sorting]-click8.config.json
index 176917e6..5df94216 100644
--- a/tests/expectations/test_rich_click[test group sorting]-click8.config.json
+++ b/tests/expectations/test_rich_click[test group sorting]-click8.config.json
@@ -114,5 +114,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test groups sorting with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test groups sorting with rich_config]-click7.config.json
index 176917e6..5df94216 100644
--- a/tests/expectations/test_rich_click[test groups sorting with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test groups sorting with rich_config]-click7.config.json
@@ -114,5 +114,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test groups sorting with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test groups sorting with rich_config]-click8.config.json
index 176917e6..5df94216 100644
--- a/tests/expectations/test_rich_click[test groups sorting with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test groups sorting with rich_config]-click8.config.json
@@ -114,5 +114,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test markdown with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test markdown with rich_config]-click7.config.json
index 09a68366..1d218ecb 100644
--- a/tests/expectations/test_rich_click[test markdown with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test markdown with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test markdown with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test markdown with rich_config]-click8.config.json
index 09a68366..1d218ecb 100644
--- a/tests/expectations/test_rich_click[test markdown with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test markdown with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test markdown]-click7.config.json b/tests/expectations/test_rich_click[test markdown]-click7.config.json
index 09a68366..1d218ecb 100644
--- a/tests/expectations/test_rich_click[test markdown]-click7.config.json
+++ b/tests/expectations/test_rich_click[test markdown]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test markdown]-click8.config.json b/tests/expectations/test_rich_click[test markdown]-click8.config.json
index 09a68366..1d218ecb 100644
--- a/tests/expectations/test_rich_click[test markdown]-click8.config.json
+++ b/tests/expectations/test_rich_click[test markdown]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars default with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test metavars default with rich_config]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test metavars default with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test metavars default with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars default with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test metavars default with rich_config]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test metavars default with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test metavars default with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars default]-click7.config.json b/tests/expectations/test_rich_click[test metavars default]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test metavars default]-click7.config.json
+++ b/tests/expectations/test_rich_click[test metavars default]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars default]-click8.config.json b/tests/expectations/test_rich_click[test metavars default]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test metavars default]-click8.config.json
+++ b/tests/expectations/test_rich_click[test metavars default]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test metavars with rich_config]-click7.config.json
index ea80c930..7031c8bc 100644
--- a/tests/expectations/test_rich_click[test metavars with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test metavars with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test metavars with rich_config]-click8.config.json
index ea80c930..7031c8bc 100644
--- a/tests/expectations/test_rich_click[test metavars with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test metavars with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars]-click7.config.json b/tests/expectations/test_rich_click[test metavars]-click7.config.json
index ea80c930..7031c8bc 100644
--- a/tests/expectations/test_rich_click[test metavars]-click7.config.json
+++ b/tests/expectations/test_rich_click[test metavars]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test metavars]-click8.config.json b/tests/expectations/test_rich_click[test metavars]-click8.config.json
index ea80c930..7031c8bc 100644
--- a/tests/expectations/test_rich_click[test metavars]-click8.config.json
+++ b/tests/expectations/test_rich_click[test metavars]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test rich markup with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test rich markup with rich_config]-click7.config.json
index 0e9627ea..2b9f5fa1 100644
--- a/tests/expectations/test_rich_click[test rich markup with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test rich markup with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test rich markup with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test rich markup with rich_config]-click8.config.json
index 0e9627ea..2b9f5fa1 100644
--- a/tests/expectations/test_rich_click[test rich markup with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test rich markup with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test rich markup]-click7.config.json b/tests/expectations/test_rich_click[test rich markup]-click7.config.json
index 0e9627ea..2b9f5fa1 100644
--- a/tests/expectations/test_rich_click[test rich markup]-click7.config.json
+++ b/tests/expectations/test_rich_click[test rich markup]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test rich markup]-click8.config.json b/tests/expectations/test_rich_click[test rich markup]-click8.config.json
index 0e9627ea..2b9f5fa1 100644
--- a/tests/expectations/test_rich_click[test rich markup]-click8.config.json
+++ b/tests/expectations/test_rich_click[test rich markup]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test simple with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test simple with rich_config]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test simple with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test simple with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test simple with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test simple with rich_config]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test simple with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test simple with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test simple]-click7.config.json b/tests/expectations/test_rich_click[test simple]-click7.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test simple]-click7.config.json
+++ b/tests/expectations/test_rich_click[test simple]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test simple]-click8.config.json b/tests/expectations/test_rich_click[test simple]-click8.config.json
index cc6e6f2c..f11b3cac 100644
--- a/tests/expectations/test_rich_click[test simple]-click8.config.json
+++ b/tests/expectations/test_rich_click[test simple]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test table styles with rich_config]-click7.config.json b/tests/expectations/test_rich_click[test table styles with rich_config]-click7.config.json
index 9c612301..3fc61d08 100644
--- a/tests/expectations/test_rich_click[test table styles with rich_config]-click7.config.json
+++ b/tests/expectations/test_rich_click[test table styles with rich_config]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test table styles with rich_config]-click8.config.json b/tests/expectations/test_rich_click[test table styles with rich_config]-click8.config.json
index 9c612301..3fc61d08 100644
--- a/tests/expectations/test_rich_click[test table styles with rich_config]-click8.config.json
+++ b/tests/expectations/test_rich_click[test table styles with rich_config]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test table styles]-click7.config.json b/tests/expectations/test_rich_click[test table styles]-click7.config.json
index 9c612301..3fc61d08 100644
--- a/tests/expectations/test_rich_click[test table styles]-click7.config.json
+++ b/tests/expectations/test_rich_click[test table styles]-click7.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }
diff --git a/tests/expectations/test_rich_click[test table styles]-click8.config.json b/tests/expectations/test_rich_click[test table styles]-click8.config.json
index 9c612301..3fc61d08 100644
--- a/tests/expectations/test_rich_click[test table styles]-click8.config.json
+++ b/tests/expectations/test_rich_click[test table styles]-click8.config.json
@@ -79,5 +79,5 @@
     "(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])",
     "(?P<metavar>\\<[^\\>]+\\>)"
   ],
-  "legacy_windows": false
+  "legacy_windows": null
 }