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

Theme function path not updated #479

Closed
hastinbe opened this issue Jan 30, 2017 · 3 comments
Closed

Theme function path not updated #479

hastinbe opened this issue Jan 30, 2017 · 3 comments
Labels
Milestone

Comments

@hastinbe
Copy link
Contributor

When setting a theme the fish_function_path is not updated to include the target theme's function path. Consequently resulting in unknown command errors afterwards, requiring the user to reload so init.fish is executed again. Apologies if this behavior is intended. hastinbe/theme-kawasaki#1 (comment)

@sagebind sagebind added themes priority: normal Normal priority labels Feb 4, 2017
@sagebind
Copy link
Member

sagebind commented Feb 5, 2017

@hastinbe I'm not entirely sure what the issue is in the linked issue or if it is related. The root directory of the active theme is always added to the function path, and this is working in my environment.

I will say that themes with a functions/ directory is actually not currently supported, as that path is not added to the function path and not used. This may change in the future.

@hastinbe
Copy link
Contributor Author

hastinbe commented Feb 5, 2017

The linked issue started as a separate issue, which is why I linked the specific comment within the issue which shows the resulting output of the issue in question. A theme's function path is added to fish_function_path during omf's init process, but when you set a new theme the fish_function_path is not updated within the current session, so it breaks the theme until omf is restarted. A theme's functions/ directory support was added when the init process was rewritten 8 months ago

From init.fish

set -l theme_function_path {$OMF_CONFIG,$OMF_PATH}/themes*/$theme{,/functions}

@sagebind
Copy link
Member

sagebind commented Feb 5, 2017

My bad, now I see what you mean. Here's a demo illustrating the problem:

<~>-> docker run -it --rm ohmyfish/ohmyfish
⋊> ~ printf "%s\n" $fish_function_path
/home/nemo/.config/fish/functions
/home/nemo/.local/share/omf/pkg/omf/functions/compat
/home/nemo/.local/share/omf/pkg/omf/functions/core
/home/nemo/.local/share/omf/pkg/omf/functions/index
/home/nemo/.local/share/omf/pkg/omf/functions/packages
/home/nemo/.local/share/omf/pkg/omf/functions/themes
/home/nemo/.local/share/omf/pkg/omf/functions/bundle
/home/nemo/.local/share/omf/pkg/omf/functions/util
/home/nemo/.local/share/omf/pkg/omf/functions/repo
/home/nemo/.local/share/omf/pkg/omf/functions/cli
/home/nemo/.local/share/omf/pkg/fish-spec/functions
/home/nemo/.local/share/omf/pkg/omf/functions
/home/nemo/.local/share/omf/lib
/home/nemo/.local/share/omf/lib/git
/home/nemo/.local/share/omf/themes/default
/usr/local/etc/fish/functions
/usr/local/share/fish/vendor_functions.d
/usr/local/share/fish/functions> ~ mkdir $OMF_PATH/themes/default/functions> ~ omf reload
⋊> ~ printf "%s\n" $fish_function_path
/home/nemo/.config/fish/functions
/home/nemo/.local/share/omf/pkg/omf/functions/compat
/home/nemo/.local/share/omf/pkg/omf/functions/core
/home/nemo/.local/share/omf/pkg/omf/functions/index
/home/nemo/.local/share/omf/pkg/omf/functions/packages
/home/nemo/.local/share/omf/pkg/omf/functions/themes
/home/nemo/.local/share/omf/pkg/omf/functions/bundle
/home/nemo/.local/share/omf/pkg/omf/functions/util
/home/nemo/.local/share/omf/pkg/omf/functions/repo
/home/nemo/.local/share/omf/pkg/omf/functions/cli
/home/nemo/.local/share/omf/pkg/fish-spec/functions
/home/nemo/.local/share/omf/pkg/omf/functions
/home/nemo/.local/share/omf/lib
/home/nemo/.local/share/omf/lib/git
/home/nemo/.local/share/omf/themes/default
/home/nemo/.local/share/omf/themes/default/functions
/usr/local/etc/fish/functions
/usr/local/share/fish/vendor_functions.d
/usr/local/share/fish/functions> ~ omf install robbyrussell
Updating https://github.com/oh-my-fish/packages-main master... Done!
Installing package robbyrussell
✔ robbyrussell successfully installed.
➜  ~ printf "%s\n" $fish_function_path
/home/nemo/.config/fish/functions
/home/nemo/.local/share/omf/themes/robbyrussell
/home/nemo/.local/share/omf/pkg/omf/functions/compat
/home/nemo/.local/share/omf/pkg/omf/functions/core
/home/nemo/.local/share/omf/pkg/omf/functions/index
/home/nemo/.local/share/omf/pkg/omf/functions/packages
/home/nemo/.local/share/omf/pkg/omf/functions/themes
/home/nemo/.local/share/omf/pkg/omf/functions/bundle
/home/nemo/.local/share/omf/pkg/omf/functions/util
/home/nemo/.local/share/omf/pkg/omf/functions/repo
/home/nemo/.local/share/omf/pkg/omf/functions/cli
/home/nemo/.local/share/omf/pkg/fish-spec/functions
/home/nemo/.local/share/omf/pkg/omf/functions
/home/nemo/.local/share/omf/lib
/home/nemo/.local/share/omf/lib/git
/home/nemo/.local/share/omf/themes/default/functions
/usr/local/etc/fish/functions
/usr/local/share/fish/vendor_functions.d
/usr/local/share/fish/functions
➜  ~

After adding a functions directory to the default theme and reloading, /home/nemo/.local/share/omf/themes/default/functions is in the function path, even if you switch to a different theme.

This is definitely a bug that we should fix. Thanks for reporting!

@sagebind sagebind added priority: high High priority and removed priority: normal Normal priority labels Feb 5, 2017
@sagebind sagebind added this to the v5 milestone Feb 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants