From 3e21d93c84c7caab50f6fe3097410297532f1d80 Mon Sep 17 00:00:00 2001 From: ranga-nir Date: Sun, 8 Feb 2026 09:25:21 +0530 Subject: [PATCH 1/2] fix(lib): use `shift`+`"$@"` in `test-ls-args` to preserve argument separation --- lib/theme-and-appearance.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 585e969d8..c8edbef08 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -40,9 +40,9 @@ if [[ -z "$LS_COLORS" ]]; then fi function test-ls-args { - local cmd="$1" # ls, gls, colorls, ... - local args="${@[2,-1]}" # arguments except the first one - command "$cmd" "$args" /dev/null &>/dev/null + local cmd="$1" # ls, gls, colorls, ... + shift # remove the command, leaving only the arguments + command "$cmd" "$@" /dev/null &>/dev/null } # Find the option for using colors in ls, depending on the version From bd6563f02df026e0626db60495df6da43df36978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 10 Feb 2026 20:21:55 +0100 Subject: [PATCH 2/2] Simplify --- lib/theme-and-appearance.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index c8edbef08..5cfa2e631 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -40,9 +40,9 @@ if [[ -z "$LS_COLORS" ]]; then fi function test-ls-args { - local cmd="$1" # ls, gls, colorls, ... - shift # remove the command, leaving only the arguments - command "$cmd" "$@" /dev/null &>/dev/null + # Usage: test-ls-args cmd args... + # e.g. test-ls-args gls --color + command "$@" /dev/null &>/dev/null } # Find the option for using colors in ls, depending on the version