mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 07:21:14 -03:00
functions/ls: Work around Terminal.app not setting $COLORTERM
Fixes #8309
This commit is contained in:
@@ -52,5 +52,14 @@ function ls --description "List contents of directory"
|
|||||||
isatty stdout
|
isatty stdout
|
||||||
and set -a opt -F
|
and set -a opt -F
|
||||||
|
|
||||||
|
# Terminal.app doesn't set $COLORTERM or $CLICOLOR,
|
||||||
|
# but the new FreeBSD ls requires either to be set,
|
||||||
|
# before it will enable color.
|
||||||
|
# See #8309.
|
||||||
|
# We don't set $COLORTERM because that should be set to
|
||||||
|
# "truecolor" or similar and we don't want to specify that here.
|
||||||
|
test "$TERM_PROGRAM" = Apple_Terminal
|
||||||
|
and set -fx CLICOLOR 1
|
||||||
|
|
||||||
command $__fish_ls_command $__fish_ls_color_opt $argv
|
command $__fish_ls_command $__fish_ls_color_opt $argv
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user