Don't use any existing LS_COLORS colors.

- The bundled color database probably looks better.
This commit is contained in:
Andrew Hamilton 2020-04-10 15:25:37 +10:00
parent 2704ccc9c3
commit 332666ec43

View file

@ -77,12 +77,9 @@ STATUS_TO_TERMSTR[Status.pending] = "."
def get_ls_color_codes(): def get_ls_color_codes():
if "LS_COLORS" not in os.environ: with importlib.resources.open_text(eris, "LS_COLORS.sh") as lscolors_file:
script = os.path.join(os.path.dirname(__file__), "LS_COLORS.sh") codes = lscolors_file.readline().strip()[len("LS_COLORS='"):-len("';")]
with open(script) as file_: return lscolors._parse_ls_colors(codes)
codes = file_.readline().strip()[len("LS_COLORS='"):-len("';")]
os.environ["LS_COLORS"] = codes
return lscolors.get_color_codes(os.environ)
_LS_COLOR_CODES = get_ls_color_codes() _LS_COLOR_CODES = get_ls_color_codes()