mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
Fix fish_config rendering brights as normal on prompt previews
I noticed our default brgreen for fish_color_user was rendering as just unstyled white.
This commit is contained in:
parent
a5e5f90f73
commit
8743961301
2 changed files with 6 additions and 5 deletions
|
@ -474,6 +474,7 @@ img.delete_icon {
|
|||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #c0c0c0; /* set_color normal, assume white (not brwhite) */
|
||||
}
|
||||
|
||||
.prompt_demo {
|
||||
|
|
|
@ -19,6 +19,7 @@ import socket
|
|||
import string
|
||||
import subprocess
|
||||
import sys
|
||||
from itertools import chain
|
||||
|
||||
FISH_BIN_PATH = False # will be set later
|
||||
IS_PY2 = sys.version_info[0] == 2
|
||||
|
@ -252,7 +253,6 @@ def get_special_ansi_escapes():
|
|||
|
||||
|
||||
def append_html_for_ansi_escape(full_val, result, span_open):
|
||||
|
||||
# Strip off the initial \x1b[ and terminating m
|
||||
val = full_val[2:-1]
|
||||
|
||||
|
@ -269,10 +269,10 @@ def append_html_for_ansi_escape(full_val, result, span_open):
|
|||
result.append('<span style="color: ' + html_color + '">')
|
||||
return True # span now open
|
||||
|
||||
# term8 foreground color
|
||||
if val in [str(x) for x in range(30, 38)]:
|
||||
# term16 foreground color
|
||||
if val in (str(x) for x in chain(range(90, 97), range(30, 38))):
|
||||
close_span()
|
||||
html_color = html_color_for_ansi_color_index(int(val) - 30)
|
||||
html_color = html_color_for_ansi_color_index(int(val) - (30 if int(val) < 90 else 82))
|
||||
result.append('<span style="color: ' + html_color + '">')
|
||||
return True # span now open
|
||||
|
||||
|
@ -282,7 +282,7 @@ def append_html_for_ansi_escape(full_val, result, span_open):
|
|||
close_span()
|
||||
return False
|
||||
|
||||
# We don't handle bold or underline yet
|
||||
# TODO We don't handle bold, underline, italics, dim, or reverse yet
|
||||
|
||||
# Do nothing on failure
|
||||
return span_open
|
||||
|
|
Loading…
Reference in a new issue