mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
fix extraction of LS_COLORS
Strip surrounding quotes if present. Fixes #3630
This commit is contained in:
parent
d0077d0910
commit
b48b2ddfb2
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue