mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
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:
parent
44eadd8bed
commit
aaf5bfc25f
1 changed files with 9 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue