From 42ef82b2c86453cb8587730e3c7ba6089e45cf20 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 24 Dec 2020 15:42:36 +0300 Subject: [PATCH] only clean full paths for colors/icons Related #505 --- colors.go | 6 +++++- icons.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/colors.go b/colors.go index 14d42d1..b6f3802 100644 --- a/colors.go +++ b/colors.go @@ -139,7 +139,11 @@ func parseStylesGNU(env string) styleMap { log.Printf("invalid $LS_COLORS entry: %s", entry) return styles } - key, val := filepath.Clean(replaceTilde(pair[0])), pair[1] + key, val := pair[0], pair[1] + key = replaceTilde(key) + if filepath.IsAbs(key) { + key = filepath.Clean(key) + } styles[key] = applyAnsiCodes(val, tcell.StyleDefault) } diff --git a/icons.go b/icons.go index 86fddac..72d167c 100644 --- a/icons.go +++ b/icons.go @@ -38,7 +38,11 @@ func parseIconsEnv(env string) iconMap { log.Printf("invalid $LF_ICONS entry: %s", entry) return icons } - key, val := filepath.Clean(replaceTilde(pair[0])), pair[1] + key, val := pair[0], pair[1] + key = replaceTilde(key) + if filepath.IsAbs(key) { + key = filepath.Clean(key) + } icons[key] = val }