Webconfig: Support reading term24bit colors for the prompt display

Otherwise this would break colors if fish detected a truecolor terminal.
This commit is contained in:
Fabian Homborg 2020-12-02 21:07:14 +01:00
parent 44eadd8bed
commit aaf5bfc25f

View file

@ -527,6 +527,15 @@ def append_html_for_ansi_escape(full_val, result, span_open):
if span_open:
result.append("</span>")
# 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('<span style="color: ' + html_color + '">')
return True # span now open
# term256 foreground color
match = re.match(r"38;5;(\d+)", val)
if match is not None: