Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last token is not used for Ctrl+T on fish shell #2562

Closed
3 tasks done
pvonmoradi opened this issue Jul 19, 2021 · 9 comments
Closed
3 tasks done

Last token is not used for Ctrl+T on fish shell #2562

pvonmoradi opened this issue Jul 19, 2021 · 9 comments

Comments

@pvonmoradi
Copy link

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

    • Linux Xubuntu 18.04
  • Shell

    • fish fish, version 3.3.1
  • FZF

    • fzf 0.27.2 (e086f0b)
@junegunn
Copy link
Owner

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.

@mcepl
Copy link

mcepl commented Feb 2, 2022

@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.

@junegunn
Copy link
Owner

junegunn commented Feb 2, 2022

@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.

@mcepl
Copy link

mcepl commented Feb 2, 2022

@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.

@junegunn
Copy link
Owner

junegunn commented Feb 3, 2022

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: #2450 (comment)

@mcepl
Copy link

mcepl commented Feb 3, 2022

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?

@mcepl
Copy link

mcepl commented Jul 3, 2024

@junegunn ??? How is this supposed to be completed? Or is this essentially WONTFIX?

@junegunn
Copy link
Owner

junegunn commented Jul 3, 2024

Have you tested the last version? It works as expected.

@jonashaag
Copy link

It does not use the last token for me

image

I type

cat ../<CTRL-T>

I get

file

but I expected

sub/file
❯ fzf --version
0.56.0 (brew)
❯ fish --version
fish, version 3.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants