jethrokuan / z

Pure-fish z directory jumping
MIT License
1.26k stars 44 forks source link

fish 3.1.0: __z --list | fzy results in tcsetattr error #86

Closed benmkw closed 4 years ago

benmkw commented 4 years ago

I used to have this

alias z="cd (__z -l 2>&1 | fzy | sed 's/^[0-9,.]* *//')"

(coming from (https://github.com/junegunn/fzf/wiki/examples#z originally)

I suspect after updating to fish 3.1.0 some behaviour of z changed because I now get tcsetattr: Input/output error (also with just running __z --list | fzy)

__z --list | fzf results in Failed to read /dev/tty while ls | fzf works fine (just to take fzf vs fzy out of the equation)

curiously something like __z --list | rg llvm works fine so I'm not sure where to proceed looking, there seems to be some interference between fzy/ fzf and z specifically which does not happen in other combinations

jethrokuan commented 4 years ago

__z --list | fzf results in Failed to read /dev/tty

__z --list | fzf works for me on Fish 3.0.2, so I think it's something to do with Fish 3.1. z hasn't been updated for a while.

benmkw commented 4 years ago

can you confirm that 3.1.0 breaks for you as well such that its not an issue with my setup? In that case I may file a bug on the fish issue tracker.

The behaviour seems to have some sort of race condition as well, as it works sometimes if I retry.

Downgrading to 3.0.2 solves the issue.

jethrokuan commented 4 years ago

as it works sometimes if I retry

honestly this should be good enough cause for filing an issue in the tracker.

I'm currently running a setup where upgrading is not very convenient for me.

benmkw commented 4 years ago

workaround is https://github.com/fish-shell/fish-shell/issues/6624#issuecomment-593012204

# workaround fish 3.1.0
# https://github.com/fish-shell/fish-shell/issues/6624#issuecomment-593012204
function fzy
    command fzy $argv
end
alias z="cd (__z -l 2>&1 | fzy | sed 's/^[0-9,.]* *//')"