From b64d99295e802b10c734de0dfed407ee093548a5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 21 Oct 2015 14:41:24 +1300 Subject: Remove directory change from pass completion --- bash/bashrc.d/pass.bash | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bash') diff --git a/bash/bashrc.d/pass.bash b/bash/bashrc.d/pass.bash index e2bc20fc..91d2d538 100644 --- a/bash/bashrc.d/pass.bash +++ b/bash/bashrc.d/pass.bash @@ -26,12 +26,11 @@ _pass() shopt -u dotglob shopt -s globstar nullglob - # Change into password directory, or bail - cd -- "$passdir" 2>/dev/null || exit - # Gather the entries and remove their .gpg suffix declare -a entries - entries=("${COMP_WORDS[COMP_CWORD]}"*/**/*.gpg "${COMP_WORDS[COMP_CWORD]}"*.gpg) + entries=("$passdir"/"${COMP_WORDS[COMP_CWORD]}"*/**/*.gpg \ + "$passdir"/"${COMP_WORDS[COMP_CWORD]}"*.gpg) + entries=("${entries[@]#$passdir/}") entries=("${entries[@]%.gpg}") # Bail if no entries to prevent empty output -- cgit v1.2.3