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

Idea: Empty output if no matches #105

Open
aude opened this issue Feb 1, 2019 · 6 comments
Open

Idea: Empty output if no matches #105

aude opened this issue Feb 1, 2019 · 6 comments

Comments

@aude
Copy link

aude commented Feb 1, 2019

Currently, if I pipe in some lines to fzy, input the garble oSh3ahngah1e and press Enter, this happens:

$ ls | fzy
oSh3ahngah1e

I think I would prefer no output in case there is no match:

$ ls | fzy

I would be easier to use together with a Bash widget I use, that opens a fuzzy find file dialog via rg and fzy. Then I'd rather get no output than incorrect output for the filename.

What do you think?

@iamleot
Copy link

iamleot commented Feb 1, 2019 via email

@aude
Copy link
Author

aude commented Feb 1, 2019

That makes sense to me.

The point I am interested in is, in your example, what happens if I type c?

If I press Return, I would want empty output, as there is no selection (because nothing matches c).
If I press Shift+Return, it might be a good idea to just output c. It sounds like you've got more experience than me there.

What do you think about that?

aude added a commit to aude/dotfiles that referenced this issue Feb 1, 2019
necessary if not this issue leads to change in upstream `fzf`:
jhawthorn/fzy#105
aude added a commit to aude/dotfiles that referenced this issue Feb 1, 2019
necessary if not this issue leads to change in upstream `fzy`:
jhawthorn/fzy#105
@iamleot
Copy link

iamleot commented Feb 2, 2019 via email

@aude
Copy link
Author

aude commented Feb 7, 2019

That is true, that's what happens in dmenu.

I would personally like if it behaved differently. Is that a possibility, or do you think it will not happen?

@jhawthorn
Copy link
Owner

Good idea. I would accept a PR which added --only-exact (or something similar) but I'd like to keep the default behaviour.

@zvezdochiot
Copy link

zvezdochiot commented Dec 28, 2019

@jhawthorn say:

I would accept a PR which added --only-exact

They forgot to mention the use of fzy, which requires an exact match:

cd /usr/bin
$(ls | fzy)

--only-exact is needed.

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

No branches or pull requests

4 participants