summaryrefslogtreecommitdiff
path: root/shell/completion.bash
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-03-07 16:26:53 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2020-03-07 16:26:53 +0900
commitbaf882ace741e4d279b6a6d2da467e00f94642f5 (patch)
tree26744d3d948918de01df871535653088aeae1abe /shell/completion.bash
parentba82f0bef99299a2c8a7a9cacde55c28568c9c3b (diff)
downloadfzf-baf882ace741e4d279b6a6d2da467e00f94642f5.tar.gz
[completion] Use file redirection instead of pipe
This change allows the completion system of bash and zsh to return before the input process completes. Related #1887
Diffstat (limited to 'shell/completion.bash')
-rw-r--r--shell/completion.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index b953cc8a..bd94c51a 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -200,7 +200,7 @@ _fzf_complete() {
if [[ "$cur" == *"$trigger" ]]; then
cur=${cur:0:${#cur}-${#trigger}}
- selected=$(cat | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS $1" __fzf_comprun "$2" -q "$cur" | $post | tr '\n' ' ')
+ selected=$(FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS $1" __fzf_comprun "$2" -q "$cur" | $post | tr '\n' ' ')
selected=${selected% } # Strip trailing space not to repeat "-o nospace"
if [ -n "$selected" ]; then
COMPREPLY=("$selected")