fzf
fzf copied to clipboard
Last token is not used for Ctrl+T on fish shell
According to https://github.com/junegunn/fzf#fish-shell, on fish shell, Ctrl+T
should use the last token as the base of recursive search but it does not behave like that. It uses CWD as the root of search.
So ls /var/
does not list files under /var/
.
https://asciinema.org/a/dhSwXLxkpUc2VaoKuag3begsH
-
OS
- [x] Linux
Xubuntu 18.04
- [x] Linux
-
Shell
- [x] fish
fish, version 3.3.1
- [x] fish
-
FZF
- [x] fzf
0.27.2 (e086f0b)
- [x] fzf
Thanks for the report. I don't use fish and I'm not familiar with its syntax, so please open a pull request if you can fix the problem.
@junegunn Exactly happens with bash, doesn’t it?
When I am in ~/build
and I write ls ~/Dok
and then I press Ctrl-T
I would expect fzf will start to search sub-tree of ~/Dokumenty
(there is no other completion of Dok
in my $HOME
directory). However, it does the worst thing. It starts from ~/build
and then adds the resulting filepath (inclduing the leading ~/Dok
) as the result, which makes it almost useless.
@mcepl Yes, as documented in https://github.com/junegunn/fzf#fish-shell
CTRL-T key binding of fish, unlike those of bash and zsh, will use the last token on the command-line as the root directory for the recursive search.
But bash and zsh have fuzzy completion.
- https://github.com/junegunn/fzf#fuzzy-completion-for-bash-and-zsh
@mcepl Yes, as documented in https://github.com/junegunn/fzf#fish-shell
CTRL-T key binding of fish, unlike those of bash and zsh, will use the last token on the command-line as the root directory for the recursive search.
OK, so perhaps this is just RFE for the option that bash (and perhaps zsh, but I don’t care for that) would behave similarly? I work for SUSE as a main Python maintainer, so my ~/build
(with all expanded packages in couple of large OBS projects) has 9500+ subdirectories and 90,000+ files. Of course, I use the fuzzy completion all the time (and thank you for that), but Ctrl-T with bash is for me essentially useless, but it could be crazily useful if I could with some gentle nudge start it in the right direction.
I actually don't know how to accomplish that in bash or zsh.
Anyway, I think it's good that CTRL-T binding is provided as a simpler, easier-to-understand alternative to fuzzy completion.
See my previous comment on that matter: https://github.com/junegunn/fzf/issues/2450#issuecomment-829856724
I actually don't know how to accomplish that in bash or zsh.
What’s the problem? You cannot read an unfinished line in a bash script?