jorgebucaran / fisher

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

`fisher update` only seems to work for current session #702

Closed macintacos closed 2 years ago

macintacos commented 2 years ago

I'm using fisher version 4.3.1 and am having the problem outlined here: https://github.com/wfxr/forgit/issues/177

I'm not 100% sure if this is a fisher issue or a forgit issue, so I'm opening an issue in both 🙂

The basic problem is, I'll call fisher update and it'll update my plugins, but when I open a new shell session it seems like those plugins weren't actually updated. Is there something else I'm supposed to do to get these updates to be "permanent"?

jorgebucaran commented 2 years ago

No way to do that at this time. I'm not sure that it's even possible. 😔

macintacos commented 2 years ago

Wait - this is intended behavior? How do people update the plugins they have installed then?

jorgebucaran commented 2 years ago

The entire body of this issue got cut off in the GitHub app, so I was only able to read the title. It seemed as an issue without a body (not all that uncommon, unfortunately).

Everything seems to be working now and I've read the whole thing.

This sounds like your $fisher_path pointing somewhere not on your functions path. How did you install Fisher? What's your $fisher_path?

macintacos commented 2 years ago

Ah, ok.

My $fisher_path is empty - is it supposed to be set to something specific?

jorgebucaran commented 2 years ago

How did you install Fisher?

macintacos commented 2 years ago

90% sure I used the same command that's in the README today:

curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

I've been using fisher for a while and only recently noticed that the updates weren't being applied, but I definitely installed fisher after 4.0, whenever that was (I've only been using fish for maybe 4 months or so)

macintacos commented 2 years ago

Oh, right. Important point. My fish config folder is a symlink to a folder that is located in a different place entirely. Would symlinks interfere with this?

jorgebucaran commented 2 years ago

Have you added those directories to your Fish functions and completions path?

macintacos commented 2 years ago

I'm not entirely sure what you mean. My fish configuration works fine as far as I can tell, I just symlink ~/.config/fish to some other directory that actually has my fish config. Everything seems to work okay together, including installing plugins and all that, but the updates to those plugins don't persist.

My config is here if you want to take a look: https://github.com/macintacos/dotfiles/tree/intel/shell/fish

jorgebucaran commented 2 years ago

Update sources updated plugins so they are immediately available in the current session. New sessions should be aware of updated functions, completions and configuration snippets as long as they are in directories in your functions and completions path.

jorgebucaran commented 2 years ago

Can you install plugins?

macintacos commented 2 years ago

Yes, all of my plugins install just fine. Still trying to see what part of my config could possibly not have the appropriate files sourced, but literally everything works (including installing new plugins, I see them come into my config's functions folder and everything) but I still for some reason can't get this to work. It's almost certainly a problem on my end but I can't figure out why, aside from maybe some weirdness with symlinks.

macintacos commented 2 years ago

So I decided to manually copy the code that gets downloaded for the forgit plugin when I run fisher update (keeping in mind that running fisher update makes it work for the current session). For context, here's the output from fisher update (just showing the stuff from forgit):

Fetching https://codeload.github.com/wfxr/forgit/tar.gz/HEAD
Installing wfxr/forgit
           /Users/juliant/.config/fish/conf.d/forgit.plugin.fish

I downloaded the tarball from the link provided and copy/pasted that code into my fish conf.d folder manually, assuming that if this is the code that is updating my shell session, surely if I copy/paste it directly to my conf.d folder I'll see from my git diff that there are changes to the code in my conf.d/forgit.plugin.fish file. But turns out, the code is exactly the same. My fish config directory is version controlled, and the data that is presumably being copied successfully when running fisher update does not even change the code when I manually copy/paste the code that it's downloading.

I'm a bit out of ideas at this point.

jorgebucaran commented 2 years ago

The only reasonable explanation I can think of would be of plugins being installed into directories that are not on your functions or completions path.

See https://fishshell.com/docs/current/language.html#syntax-function-autoloading

macintacos commented 2 years ago

Everything I am installing with fisher gets installed into my functions path, and as far as I can tell works as intended. I know this because my entire fish config is in version control, and when I run something like fisher install blah or fisher remove blah I see the corresponding files added and removed from the functions folder in my fish config. It's just fisher update that doesn't work for more than a single shell session.

I'll pour over the docs just to be 100% sure I'm not missing anything, thanks for the pointer.

macintacos commented 2 years ago

The more I look into this the more I want to put the blame on the actual plugin I'm using, so I'll also push more on that angle as well.

macintacos commented 2 years ago

I'm going to close this for now - if I have any evidence that fisher is to blame I'll reopen this.

jorgebucaran commented 2 years ago

Could you create a local plugin and test this out?

~/testplugin
└── functions
    └── testplugin.fish
function testplugin
  echo 1
end

Install it. Make sure that it works and that the files are saved to ~/.config/fish/functions as usual. Change the counter, then fisher update ~/testplugin and see if it does what we expect.

Fujiwara-Chika commented 1 year ago

Same issues. when I open a new session, the fzf plugin weren't actually updated.

image image
jorgebucaran commented 1 year ago

First, uninstall Oh My Fish. You don't need it.

Then install Fisher as advised:

curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

Now you can install fzf.fish:

fisher install PatrickF1/fzf.fish

You should be good now.

Fujiwara-Chika commented 1 year ago

I did what you said, but the problem still exists

jorgebucaran commented 1 year ago

Why did you install fzf and Fisher with Oh My Fish? And why did you try to update them with Fisher?