zshrc: test if ls is GNU ls instead of islinux()
authorMoviuro <moviuro+grml@gmail.com>
Sun, 17 Jan 2016 06:45:23 +0000 (07:45 +0100)
committerMoviuro <moviuro+grml@gmail.com>
Sun, 17 Jan 2016 06:45:23 +0000 (07:45 +0100)
etc/zsh/zshrc

index 9040369..a09361c 100644 (file)
@@ -442,7 +442,7 @@ fi
 
 # Natural sorting order on GNU ls(1)
 # OSX and IllumOS have a -v option that is not natural sorting
-if islinux && ls -v / >/dev/null 2>&1; then
+if ls --version |& grep -q 'GNU' >/dev/null 2>&1 && ls -v / >/dev/null 2>&1; then
     ls_options+=( -v )
 fi