From 07d89df04c5705cec39d6bdd10aea00bd5eb67e3 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Fri, 24 Sep 2021 21:17:16 -0700 Subject: [PATCH] Make smaller 'reset's --- ansi.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansi.py b/ansi.py index dfbf48a..4c09db3 100755 --- a/ansi.py +++ b/ansi.py @@ -1738,6 +1738,9 @@ def fg(name: Optional[str] = "", force_216color: bool = False) -> str: import string_utils + if name is not None and name == 'reset': + return '\033[39m' + if name is not None and string_utils.is_full_string(name): rgb = _find_color_by_name(name) return fg( @@ -1822,6 +1825,9 @@ def bg(name: Optional[str] = "", force_216color: bool = False) -> str: import string_utils + if name is not None and name == 'reset': + return '\033[49m' + if name is not None and string_utils.is_full_string(name): rgb = _find_color_by_name(name) return bg( -- 2.47.1