From fe7f96bb88011eba25d52f18923de0028efee93f Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 27 Nov 2022 15:02:44 +0000 Subject: [PATCH] fish: Only use color ls if available --- fish/functions/ls.fish | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fish/functions/ls.fish b/fish/functions/ls.fish index 6c56508..0a2103c 100644 --- a/fish/functions/ls.fish +++ b/fish/functions/ls.fish @@ -1,7 +1,9 @@ -function ls --description 'List contents of directory' - if type -q gls +if type -q gls + function ls --description 'List contents of directory' command gls --color=auto $argv - else + end +else if command ls --color=auto &>/dev/null + function ls --description 'List contents of directory' command ls --color=auto $argv end end