diff --git a/share/functions/ls.fish b/share/functions/ls.fish index d2ffb8c98..7418195f4 100644 --- a/share/functions/ls.fish +++ b/share/functions/ls.fish @@ -23,6 +23,10 @@ if command ls --version >/dev/null ^/dev/null # Here we rely on the legacy behavior of `dircolors -c` producing output suitable for # csh in order to extract just the data we're interested in. set -gx LS_COLORS (dircolors -c $colorfile | string split ' ')[3] + # The value should always be quoted but be conservative and check first. + if string match -qr '^([\'"]).*\1$' -- $LS_COLORS + set LS_COLORS (string match -r '^.(.*).$' $LS_COLORS)[2] + end end end else if command ls -G / >/dev/null ^/dev/null