From 9e9470c7edd2592204a5f019e49998e796064851 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Sat, 5 Dec 2026 21:04:27 -0700 Subject: [PATCH] test(console): build the width test console outside Rich legacy Windows mode --- tests/core/test_console_width.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/core/test_console_width.py b/tests/core/test_console_width.py index 2dcb5156..019773b6 100644 --- a/tests/core/test_console_width.py +++ b/tests/core/test_console_width.py @@ -6,6 +6,8 @@ from pathlib import Path import pytest SCRIPT = """ +import rich.console +rich.console.detect_legacy_windows = lambda: False from unshackle.core.config import config config.wide_output = {wide} from rich.padding import Padding @@ -31,6 +33,7 @@ def test_console_follows_wide_output(wide: bool, width: int) -> None: """With wide_output the console takes the terminal width and track bars fill the line to one right edge. Without it the console holds 80 columns and each bar 40 cells. Both are read at import, hence the subprocess. + The child turns off Rich legacy Windows mode, which on a Windows pipe drops one column and draws ASCII bars. """ out = subprocess.run( [sys.executable, "-c", SCRIPT.format(wide=wide)],