Closed przepompownia closed 1 year ago
Hello
I'm not able to reproduce this behaviour. Are you able to give more details on what does not work (it hangs, no results given, wrong results given etc) and what shell you are using.
I added the following to my ssh config
Host foo
HostName 127.0.0.1
and both zsh and bash gave me the expected results when completiong scp foo:
(bash with fzf-tab-completion listed no files, but so did bash with builtin completion).
I also tried against another computer (ie not 127.0.0.1) which also worked.
@lincheney thanks for trying.
I see only Loading matches ...
about 8 s then the dialog closes without results and I can try again.
. /usr/share/bash-completion/bash_completion
. "$(realpath "$(dirname ${BASH_SOURCE[0]})")/.src/external/fzf-tab-completion/bash/fzf-bash-completion.sh"
bind -x '"\t": fzf_bash_completion'
bind '"\es": menu-complete'
bind '"\eS": menu-complete-backward'
with
env -i -- SSH_AUTH_SOCK="$SSH_AUTH_SOCK" bash --rcfile ~/.bashrc-fzf-tab.sh
Alt-s
(or Esc-s
) work as expected for me. Doesn't matter if I use Tmux with Kitty or pure XTerm.
I'm not familiar with zsh. With
source /etc/default/locale
source "${HOME}/.src/external/fzf-tab-completion/zsh/fzf-zsh-completion.sh"
bindkey '^I' fzf_completion
I get No such widget `fzf_completion'
with Tab. After entering source "${HOME}/.src/external/fzf-tab-completion/zsh/fzf-zsh-completion.sh"
manually, I get fzf_completion:69: command not found: _main_complete
. _main_complete
seems to be not defined in this project. I have installed zsh in Debian Sid.
Hello
I have pushed this https://github.com/lincheney/fzf-tab-completion/commit/428f350b86a43dd5d259295e9a695dc073cc1bdf, are you able to see if this fixes it for you? I am not confident though, as the behaviour I am seeing with scp does not seem quite the same as yours. Do you get the 8s delay only with the fzf completion?
Yes, I get this timeout only with fzf completion.
With 428f350b86a43dd5d259295e9a695dc073cc1bdf I see that file tree is completed correctly (I checked it remotely too) but the result replaces the whole word i.e. the host name and colon disappears (doesn't matter if I start directly after the colon or with some leading characters).
the host name and colon disappears
If I am completing paths for scp, I am getting the same behaviour if I use the normal bash completion, so it is expected (if incorrect) behaviour in my case. Are you getting something different? Unfortunately I am not experiencing the timeout on my end. It may be something I will have to rely on you to debug.
I am getting the same behaviour if I use the normal bash completion
ahh I actually it appears this is happening because I am overriding $COMP_WORDBREAKS in my bashrc I will see if I can fix this
Please look here: https://asciinema.org/a/fVMZLEVOTNArDAB0ccGf4U2Nw
Yes, the code was not handling $COMP_WORDBREAKS properly. Can you try out https://github.com/lincheney/fzf-tab-completion/commit/da0e8ed66a36a5c1dabc247faa6a766f771809c4
scp foo:
- works correctly, i.e. results with scp foo:/home/test/
scp foo:tmp
returns empty result in oppose to built-in bash completion. but... it was after exec bash
from the shell with the old library :grin: Maybe some environment was exported into the new shell.
On a fresh shell it seems to complete, but only if foo
is an alias to localhost
. I was close to closing this issue, but I see that results for some remote machine comes from the local machine.
Please test it for some remote host.
ahhhh ok how about this https://github.com/lincheney/fzf-tab-completion/commit/9b056d8011a0d46cb60e700f8cf528aef00ababa 🤞
With https://github.com/lincheney/fzf-tab-completion/commit/9b056d8011a0d46cb60e700f8cf528aef00ababa I get the correct completion :tada:
Great thanks for the non-trivial work (as usual here)!
Assuming that you have
foo
host configured in ~/.ssh/config and its identity added to an agent sossh foo
is enough to access the remote host. Typessh foo:
and try to complete possible home directory paths both with built-in and fzf-tab-completion.For me only built-in completion works.