[pass] [PATCH] tree listing: remove .gpg at the end, but keep bash colorzing

Lorenz Weber mail at lenzw.de
Sat Sep 20 22:22:49 CEST 2014

the patch below keeps the current behaviour of removing .gpg at the end
of the line in the tree listing, but works with colorized lines now, too.

Before something like
would have been output in blue, with the suffix .gpg

with this patch, it will be reduced to
still rendering it blue, but without the .gpg file suffix.

This sould work things out on systems with weird file access settings
that lead to tree colorizing the output on files.


>From 452efb10432fc54147a44104f26f4636ad6133bd Mon Sep 17 00:00:00 2001
From: Lorenz Weber <mail at lenzw.de>
Date: Sat, 20 Sep 2014 22:14:15 +0200
Subject: [PATCH] tree listing: remove .gpg at the end, but keep bash

 src/password-store.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 2287a46..851b371 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -332,7 +332,7 @@ cmd_show() {
                        echo "${path%\/}"
-               tree -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed
+                tree -C -l --noreport "$PREFIX/$path" | tail -n +2 |
sed 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}$/\1/' #remove .gpg at end of line,
but keep colors
        elif [[ -z $path ]]; then
                die "Error: password store is empty. Try \"pass init\"."

More information about the Password-Store mailing list