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

Fish shell integration Ctrl+T file search outside current working directory #4277

Open
RadimEZ opened this issue Feb 23, 2025 · 3 comments
Open

Comments

@RadimEZ
Copy link

RadimEZ commented Feb 23, 2025

This is about the fish shell intgration of fzf, not fzf itself

fzf 0.57.0
fish 3.7.1
("pwd" means "current working directory")

When I set up fzf's fish-integration initially I remember a different behaviour.

Consider the following example:

  1. Enter another directory

~> cd /tmp/
/tmp>

now my pwd is /tmp/

  1. Prepare prompt

I enter the following prompt and press Ctrl+T

/tmp> cat file.txt ~/Documents/

  1. Observe result

old/good:
Previously it would search within ~/Documents/ allowing me to enter search phrase (despite pwd still /tmp/)

current/bad:
Now it searches within pwd (here /tmp) and pre-fills the search phrase with the term "~/Documents/" which is not what I need.

How to fix it? How to restore previous behaviour? Cannot use Ctrl+T with paths outside current working directory like this.

Any support is highly appreciated. Thanks in advance.

@RadimEZ RadimEZ marked this as a duplicate of jethrokuan/fzf#185 Feb 23, 2025
@RadimEZ
Copy link
Author

RadimEZ commented Feb 23, 2025

Further investigation revealed it only works with variables but not ~ itself

For example
/tmp> cat file.txt ~/Documents/
then pressing Ctrl+T searches within /tmp/ looking for ~/Documents/

and
/tmp> cat file.txt $HOME/Documents/
correctly expands and searches within the path provided at the prompt level

Maybe it has always been like that (but I don't remember ever having to use the $HOME variable explititly either).

It could be considered as a further improvement for the future, to handle ~ exactly like $HOME.

@junegunn
Copy link
Owner

Please test with the latest version of fzf, 0.60.1.

@RadimEZ
Copy link
Author

RadimEZ commented Feb 23, 2025

Will report back as soon as my distribution provides updated packages

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

2 participants