From sebastien.peterson.boudreau at gmail.com Thu Feb 5 20:36:06 2026 From: sebastien.peterson.boudreau at gmail.com (sebastien peterson boudreau) Date: Thu, 5 Feb 2026 16:36:06 -0400 Subject: [PATCH] Do not force colours Message-ID: <20260205204144.14139-1-sebastien.peterson.boudreau@gmail.com> There is _no_ reason to force colours with -C; the user can already opt-in by setting LS_COLORS (see tree(1)). --- I did try to disable colour by exporting NO_COLOR (as per tree(1)), but it didn't work. If it's _really_ necessary, maybe a flag could be added for the pass ls of subcommands to _enable_ colour, but having it on by default, even if our output isn't even a tty, is **anti-unix** (doesn't work well with pipes). I'd even go a step further to say that pass should use ls(1) for the ls subcommand(s) and find(1) for the find subcommand because tree is not standardized and doesn't provide much aside from replicating what a handful of other commands do with ``prettier" output -- harmful! src/password-store.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/password-store.sh b/src/password-store.sh index 22e818f..fea4a05 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -402,7 +402,7 @@ cmd_show() { else echo "${path%\/}" fi - tree -N -C -l --noreport "$PREFIX/$path" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors + tree -N -l --noreport "$PREFIX/$path" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors elif [[ -z $path ]]; then die "Error: password store is empty. Try \"pass init\"." else @@ -414,7 +414,7 @@ cmd_find() { [[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..." IFS="," eval 'echo "Search Terms: $*"' local terms="*$(printf '%s*|*' "$@")" - tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' + tree -N -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' } cmd_grep() { -- 2.53.0