Fix fish shell support on Ubuntu #60

junegunn opened this Issue Jun 19, 2014 · 12 comments

2 participants

fish: Expected redirection specification, got token of type '$TMPDIR/fzf.result'
(line 16): __fzf_select > $TMPDIR/fzf.result in function '__fzf_ctrl_t', called on standard input,

@junegunn junegunn added the bug label Jun 19, 2014
@junegunn junegunn changed the title from TMPDIR error on fish to Fix fish shell support on Ubuntu Jun 19, 2014

Hmm, even a very simple ls | fzf doesn't work reliably on fish on Ubuntu 14.

jg@jg-VirtualBox ~> ls | fzf
  # returns immediately
jg@jg-VirtualBox ~> fg
Send job 2, “/usr/bin/ruby --disable-gems /home/jg/.fzf/fzf $argv” to foreground
/home/jg/.fzf/fzf:791:in `getc': Input/output error (Errno::EIO)
    from /home/jg/.fzf/fzf:791:in `get_input'
    from /home/jg/.fzf/fzf:995:in `start_loop'
    from /home/jg/.fzf/fzf:232:in `start'
    from /home/jg/.fzf/fzf:1194:in `<main>'

I am also having this issue...


Yup, It seems to be caused by a bug or limitation of fish on Linux, unlike ls | fzf, ls | ruby ~/.fzf/fzf works fine. I'm looking for a workaround.


I'm working on making suck less for my dotfiles, (no offense, it's just not good fish 😝) and you're welcome to my changes when I finish.

Also, seems to be working for me when I set TMPDIR. I fix this in my changes, among other issues.

The changed code will be in neersighted/dotfiles.


Sounds great, actually I was secretly hoping for some help :)
It would be even better if TMPDIR is not required all. Please let me know of the progress, thanks!


Does fzf not block in pipes? I seem to be having some trouble with a cd from stdin function, debugging shows that the function is being called before fzf writes to stdout.


Awesome! I'll test it tonight. You interested in sending a pull request?

And, have you found a way to circumvent the aforementioned problem (#60 (comment))? It happens on Ubuntu, but not on OSX.


I can pull it out into a pull request or you can just copy the file from my repo. It seems to fix this issue for me.


Either way is fine for me. Just felt like I should ask you first :)

@neersighted neersighted added a commit that referenced this issue Jun 24, 2014
@neersighted neersighted [install] refactor 🔥
The script should now be much more resistant and less brittle.

Major changes include:
* Drop temporary files in favor of a wrapper (similar to xargs)
* Redirect stderr with ^
* Line breaks for readability
* General best practices

Fixes #60

Ah, my ls is long by default. If I define fzf as a function and pipe dir, or command ls into it, it hangs. However, I think this is a fzf issue with one line of input, as the output of ls/dir is only one line long and space delimited. I do not have the same issue with find.

@junegunn junegunn added a commit that referenced this issue Jul 6, 2014
@junegunn [fish] Fix fish key binding issues (#60)
Although a major overhaul is ongoing (#67), it is not yet finished and
cannot be considered stable enough for the next release. This commit
fixes a few apparent issues with small change to the current

- Fixed error when $TMPDIR is not defined
- Better escaping of file/directory names
- Splitted functions to workaround fish bug
@junegunn junegunn closed this Jul 13, 2014
@floam floam referenced this issue in fish-shell/fish-shell Aug 1, 2016

Command pipeline works unexpectedly #3277

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment