Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected and strange error "Unknown command: humanize_duration" #122

Closed
romanrev opened this issue Oct 21, 2021 · 7 comments
Closed

Unexpected and strange error "Unknown command: humanize_duration" #122

romanrev opened this issue Oct 21, 2021 · 7 comments

Comments

@romanrev
Copy link

romanrev commented Oct 21, 2021

After I've upgraded my Fisherman I've started getting this kind of strange error in my terminal after a command finishes. I've already tried removing the done plugin and installing it again, but it doesn't seem to help. I cannot find the humanize_duration in the done.fish file BTW, so not sure how to debug it. Any hints are greatly appreciated!

➤ fish --version
fish, version 3.1.2
➤ fisher --version
fisher, version 4.3.0

fish: Unknown command: humanize_duration
~/.config/fish/conf.d/done.fish (line 1): 
echo "$cmd_duration" | humanize_duration
                       ^
in command substitution
	called on line 146 of file ~/.config/fish/conf.d/done.fish
in function '__done_ended'
in event handler: handler for generic event 'fish_prompt'
~/.config/fish/conf.d/done.fish: Unknown error while evaluating command substitution
in function '__done_ended'
in event handler: handler for generic event 'fish_prompt'
@ammgws
Copy link
Contributor

ammgws commented Oct 21, 2021

Looks like you're on an old version of done, since that function was internalised in the code quite a while ago.

The error is probably because that package was renamed to humantime: https://github.com/jorgebucaran/humantime.fish/

Anyway, updating done should resolve your issue

@romanrev
Copy link
Author

thanks for your prompt feedback @ammgws ! But I have already updated done, or so I thought at least, by running fisher update franciscolourenco/done - several times already in fact. Could you tell what is the way to confirm the update has actually happened, except for observing the output?

➤ fisher update franciscolourenco/done
fisher update version 4.3.0
Fetching https://codeload.github.com/franciscolourenco/done/tar.gz/HEAD
Installing franciscolourenco/done
           /Users/roman/.config/fish/conf.d/done.fish
Updated 1 plugin/s

thank you!

@romanrev
Copy link
Author

ok, I've downloaded the done.fish file from GH directly and compared it to the one installed in my ~/.config/fish/conf.d/done.fish - they look identical:

➤ diff -u ~/.config/fish/conf.d/done.fish /tmp/done.fish
<nil>

I wonder if somehow the old done is still used in my shell? Do you know if there is a way to ensure the plugin code is reloaded in memory after update?

@ammgws
Copy link
Contributor

ammgws commented Oct 21, 2021

I believe fisher is meant to source the new files automatically, perhaps try asking there?
https://github.com/jorgebucaran/fisher/blob/b2c317a2aecb69727da9c2b88c730bb5537e2d26/functions/fisher.fish#L173-L174

Try running functions __done_humanize_duration, it should return the definition of the function, otherwise the currently loaded done.fish is old.

I recommend just spinning up a new shell for now.

@romanrev
Copy link
Author

thanks for the hint with checking the function is defined, it was empty indeed! I've sourced the ~/.config/fish/conf.d/done.fish manually and it has obviously defined it correctly. I am guessing fisher is sourcing the new plugin files automatically once it is updated, but obviously that doesn't happen in the multitude of terminal tabs I have open on my computer 😁 Thanks again for hand-holding me, I am closing this ticket now

@franciscolourenco
Copy link
Owner

For future reference, you can also get the loaded version of done with

echo $__done_version

@romanrev
Copy link
Author

great to know, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants