Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix fish shell support on Ubuntu #60

Closed
junegunn opened this Issue · 12 comments

2 participants

@junegunn
Owner
fish: Expected redirection specification, got token of type '$TMPDIR/fzf.result'
/home/endetti/.config/fish/functions/fish_user_key_bindings.fish 
(line 16): __fzf_select > $TMPDIR/fzf.result in function '__fzf_ctrl_t', called on standard input,

http://www.reddit.com/r/vim/comments/28eh6k/fzf_vim_tmux/ciavblg

@junegunn junegunn added the bug label
@junegunn junegunn changed the title from TMPDIR error on fish to Fix fish shell support on Ubuntu
@junegunn
Owner

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>'
@neersighted

I am also having this issue...

@junegunn
Owner

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.

@neersighted

I'm working on making fzf_key_bindings.fish suck less for my dotfiles, (no offense, it's just not good fish :stuck_out_tongue_closed_eyes:) 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.

@junegunn
Owner

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!

@neersighted

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.

@junegunn
Owner

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.

@neersighted

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.

@junegunn
Owner

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

@neersighted neersighted referenced this issue from a commit
@neersighted neersighted [install] refactor fzf_key_bindings.fish :fire:
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
d564cde
@neersighted

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 referenced this issue from a commit
@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
implementation.

- Fixed error when $TMPDIR is not defined
- Better escaping of file/directory names
- Splitted functions to workaround fish bug
daf08f8
@junegunn junegunn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.