Hi!
When I set $PASSWORD_STORE_DIR to a directory name like
"~/.custom-dir-name" the bash autocompletion doesn't give me suggestions of
folders and entries in my pass store. This seems to be because the bash
autocomplete script doesn't finish off the $PASSWORD_STORE_DIR variable
with a forward slash as it does when the $PASSWORD_STORE_DIR is not set.
The attached supertiny patch solves this issue for me.
From 8a635e2c1d341957f8ba25524c559593974afc26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor=20Nilsson=20=C3=96hrn?= <[email protected]>
Date: Mon, 23 Feb 2015 16:00:04 +0100
Subject: [PATCH] Fix bash autocompletion bug when custom pass-dir is set

---
 src/completion/pass.bash-completion | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion
index ea31fbf..1047542 100644
--- a/src/completion/pass.bash-completion
+++ b/src/completion/pass.bash-completion
@@ -5,7 +5,7 @@
 # This file is licensed under the GPLv2+. Please see COPYING for more information.
 
 _pass_complete_entries () {
-	prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store/}"
+	prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}/"
 	suffix=".gpg"
 	autoexpand=${1:-0}
 
@@ -41,7 +41,7 @@ _pass_complete_entries () {
 }
 
 _pass_complete_folders () {
-	prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store/}"
+	prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}/"
 
 	local IFS=$'\n'
 	local items=($(compgen -d $prefix$cur))
-- 
2.3.0

_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to