Skip to content

Commit 2c0402c

Browse files
committed
Fixed scons colors under windows.
1 parent b1cf3e4 commit 2c0402c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

apio/common/rich_lib_windows.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@ def apply_workaround(params: RichLibWindowsParams):
3535
to apply the the workaround for the rich library."""
3636
assert params.IsInitialized, params
3737

38-
# This takes care of the table graphic box.
39-
# https://github.com/Textualize/rich/issues/3625
38+
# -- This takes care of the table graphic box.
39+
# -- See https://github.com/Textualize/rich/issues/3625
4040
sys.stdout.reconfigure(encoding=params.stdout_encoding)
4141

4242
# This enables the colors.
43-
# https://github.com/Textualize/rich/issues/3082
43+
# See https://github.com/Textualize/rich/issues/3082
44+
45+
# -- Make sure that _windows_console_features is initialized with cached
46+
# -- values.
47+
rich.console.get_windows_console_features()
4448
assert rich.console._windows_console_features is not None
49+
50+
# -- Apply the patch.
4551
rich.console._windows_console_features.vt = params.vt
4652
rich.console._windows_console_features.truecolor = params.truecolor

0 commit comments

Comments
 (0)