diff options
| author | Bob Matcuk <bmatcuk@gmail.com> | 2022-07-29 08:50:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-29 21:50:59 +0900 |
| commit | 68cf393644e3eea0cc41b472b95c101bf12e3580 (patch) | |
| tree | 3d73bcea9fdbc97b3d0a5381efb89098755f1b51 | |
| parent | 18f7230662a5b8a5381d6b88ddd94621844e22bc (diff) | |
| download | fzf-68cf393644e3eea0cc41b472b95c101bf12e3580.tar.gz | |
[bash] Fix 'possible retry loop' problem of bash-completion (#2891)
Close #2474
Close #2583
| -rw-r--r-- | shell/completion.bash | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/completion.bash b/shell/completion.bash index b1e79353..77aa5807 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -161,7 +161,11 @@ _fzf_handle_dynamic_completion() { __fzf_generic_path_completion() { local cur base dir leftover matches trigger cmd - cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}" + cmd="${COMP_WORDS[0]}" + if [[ $cmd == \\* ]]; then + cmd="${cmd:1}" + fi + cmd="${cmd//[^A-Za-z0-9_=]/_}" COMPREPLY=() trigger=${FZF_COMPLETION_TRIGGER-'**'} cur="${COMP_WORDS[COMP_CWORD]}" |
