Closed Susensio closed 1 year ago
I'm trying to figure out what's happening. Here goes a MRE:
conf.d/fisher.fish
if not functions -q fisher
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
end
and the output is
fisher install version 4.4.3
fisher install version 4.4.3
fisher install version 4.4.3
fisher install version 4.4.3
...
fisher install version 4.4.3
fisher install version 4.4.3
^CFetching https://api.github.com/repos/jorgebucaran/fisher/tarball/HEAD
So it seem to be entering a infinite loop when calling fisher install
, where it sources conf.d/fisher.fish
again. Control+C breaks the loop but fisher
command does not work
I found the problem: fisher install
spawns fish
subprocesses with fish --command
that read configuration files, hence the infinite loop.
I've solved it checking if running from interactive session with status is-interactive
.
This is the solution I've implemented (maybe this could be added to documentation):
if not functions -q fisher; and status is-interactive
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
end
I think this is a workaround and maybe fisher install
should call fish --no-config --command
, but I don't know for sure if this change could cause any problems.
Close, but you'd still need to check for interactivity. So, that's the best solution we know of.
You can use && instead of ; and in modern Fish, by the way.
A PR to improve the docs is always welcome! 🙆♂️
How can I configure
~/.config/fish/config.fish
to autoinstall fisher, just like fundle does?Fundle proposes adding
if not functions -q fundle; eval (curl -sfL https://git.io/fundle-install); end
toconfig.d
. I've tried something similar with fisher with no luck.