aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-10-21 14:41:24 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-10-21 14:41:24 +1300
commitb64d99295e802b10c734de0dfed407ee093548a5 (patch)
tree8a3d4dfcae520c08f875094ebf398ea8d104b5a8 /bash
parentFix another comment typo (diff)
downloaddotfiles-b64d99295e802b10c734de0dfed407ee093548a5.tar.gz
dotfiles-b64d99295e802b10c734de0dfed407ee093548a5.zip
Remove directory change from pass completion
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/pass.bash7
1 files changed, 3 insertions, 4 deletions
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