From aaf5bfc25f584ff9c0db6f81ec76104f2d7434ea Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 2 Dec 2020 21:07:14 +0100 Subject: [PATCH] Webconfig: Support reading term24bit colors for the prompt display Otherwise this would break colors if fish detected a truecolor terminal. --- share/tools/web_config/webconfig.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 763cda13b..07e17183c 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -527,6 +527,15 @@ def append_html_for_ansi_escape(full_val, result, span_open): if span_open: result.append("") + # term24bit foreground color + match = re.match(r"38;2;(\d+);(\d+);(\d+)", val) + if match is not None: + close_span() + # Just use the rgb values directly + html_color = "#%02x%02x%02x" % (int(match.group(1)), int(match.group(2)), int(match.group(3))) + result.append('') + return True # span now open + # term256 foreground color match = re.match(r"38;5;(\d+)", val) if match is not None: