From 157e1a167cb940f3b31501ce9ff9c6172d8937be Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 27 Jun 2025 12:57:34 +0100 Subject: [PATCH] fixes bug when setting --style=disabled (we were stil getting coloured check/cross marks) --- obsws_cli/styles.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/obsws_cli/styles.py b/obsws_cli/styles.py index d128b27..32065cd 100644 --- a/obsws_cli/styles.py +++ b/obsws_cli/styles.py @@ -42,11 +42,6 @@ class Disabled(Style): column: str = 'none' highlight: str = 'none' - def __post_init__(self): - """Post-initialization to set default values.""" - super().__post_init__() - os.environ['NO_COLOR'] = '1' - @register_style @dataclass @@ -182,4 +177,7 @@ class Black(Style): def request_style_obj(style_name: str, no_border: bool) -> Style: """Entry point for style objects. Returns a Style object based on the style name.""" + if style_name == 'disabled': + os.environ['NO_COLOR'] = '1' + return registry[style_name.lower()](no_border=no_border)