88659ed193cd1af0ba3679c9de3c85f21003f3d4

Author
Ranga Nirmal <ranganirmal789@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(appearance): ensure arg separation in `test-ls-args` (#13556)

Co-authored-by: Marc Cornellà <marc@mcornella.com>

Diff

 1diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
 2index 585e969d881e0f9760c19d512d24fa297c541fdb..5cfa2e631f0b2b3a148a8b6ceca18fd24123aefa 100644
 3--- a/lib/theme-and-appearance.zsh
 4+++ b/lib/theme-and-appearance.zsh
 5@@ -40,9 +40,9 @@ if [[ -z "$LS_COLORS" ]]; then
 6 fi
 7 
 8 function test-ls-args {
 9-  local cmd="$1"          # ls, gls, colorls, ...
10-  local args="${@[2,-1]}" # arguments except the first one
11-  command "$cmd" "$args" /dev/null &>/dev/null
12+  # Usage: test-ls-args cmd args...
13+  # e.g. test-ls-args gls --color
14+  command "$@" /dev/null &>/dev/null
15 }
16 
17 # Find the option for using colors in ls, depending on the version