Some paths have no lscolors entry.

- Using the default style, white on black.
This commit is contained in:
Andrew Hamilton 2022-01-09 11:20:41 +10:00
parent f5fb1cc84a
commit 2f328ee595

View file

@ -697,6 +697,8 @@ def run_tool_no_error(path, tool):
def _charstyle_of_path(path):
color_code = lscolors.color_code_for_path(path, _LS_COLOR_CODES)
if color_code is None:
return termstr.CharStyle()
term_text = termstr.ESC + "[" + color_code + "m-"
return termstr.TermStr.from_term(term_text).style[0]