jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.53k stars 257 forks source link

fisher install infloop on fish update from 3.4.1 to 3.5.1 #727

Closed tsdh closed 1 year ago

tsdh commented 1 year ago

First of all, thanks a lot for fisher. I'm using it for years. :-)

Today I've updated fish from 3.4.1 to 3.5.1. I have a ~/.config/fish/conf.d/01_fisher.fish with these contents:

if not functions -q fisher
    curl -sL git.io/fisher | source && fisher install jorgebucaran/fisher
end

I don't know why during after the update, the fisher function wasn't defined but firing up a new fish dropped that into a fisher install infloop. I guess the curl ... | source && fisher install ... line invokes fish again which causes 01_fisher.fish to be run again and so forth. Well, but why is functions -q fisher true on the second run? I have no clue but asked on #fish@oftc and report back when I got a reply as to what change in fish might cause that behavior.

jorgebucaran commented 1 year ago

You are absolutely right. Solution: run this code only if interactive:

if status is-interactive
    functions --query fisher || curl -sL git.io/fisher | source && fisher install jorgebucaran/fisher
end
tsdh commented 1 year ago

Your snippet installs fisher every time I start a new fish shell because:

❯ true || echo "false" && echo "done"
done
~ 
❯ false || echo "false" && echo "done"
false
done

That seemed very surprising to me but bash and zsh agree that's the way it's supposed to be.

I'm now using this which works:

if status is-interactive && ! functions --query fisher
    curl -sL git.io/fisher | source \
        && fisher install jorgebucaran/fisher
end

But I wonder how my original snippet worked for years throughout many fish updates...

Anyway, problem solved.

jorgebucaran commented 1 year ago

Ahhhh, I stand corrected! 😅

Yep, I'm glad you got it working.