You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ubuntu 24.04 on Windows 10 WSL using zsh 5.9 with Oh My Zsh plus ZBrowse and ZUI plugins
Reproduction steps
Install ZBrowse to the OMZ custom plugins directory per the ZBrowse installation isntructions for OMZ
Install ZUI to the OMZ custom plugins directory according to the ZUI installation isntructions for OMZ
Add zbrowse and zui to OMZ's plugins array in .zshrc
Reload the shell or run omz reload
Press crtl+b to launch ZBrowse
Note: I tested this with AND without other OMZ plugins being loaded and the behaviour was the same.
Expected behavior
pressing ctrl+b will launch ZBrowse
Current behavior
Pressing ctrl+b to launch ZBrowse results in the following error:
zbrowse:482: zui-event-loop: function definition file not found
Code snippet
From .zshrc
# Which plugins would you like to load?# Standard plugins can be found in $ZSH/plugins/# Custom plugins may be added to $ZSH_CUSTOM/plugins/# Example format: plugins=(rails git textmate ruby lighthouse)# Add wisely, as too many plugins slow down shell startup.
plugins=(
zui
zbrowse
)
Additional information
First of all, I realize this may very well be an issue with Oh My Zsh. If that is the case, please let me know and I will go there for resolution. I am not a zsh expert and my experience is limited to using it as my shell with OMZ.
Workaround:
A workaround for this issue is to load ZUI directly, per the Standalone installation instuctions. Placing
source {where-zui-is}/zui.plugin.zsh
in my .zshrc file yields a successful result.
Details:
When loading ZUI as a plugin via OMZ, ZUI's functions directory ($ZUI_REPO_DIR/functions) is not added to the fpath array.
The failure appears to happen due to the following code block (zui.plugin.zsh lines 26-31):
# Update FPATH if:# 1. Not loading with ZI# 2. Not having fpath already updated (that would equal: using other plugin manager)if [[ -z"$ZI_CUR_PLUGIN"&&"${fpath[(r)$ZUI_REPO_DIR]}"!=$ZUI_REPO_DIR ]];then
fpath+=( "$ZUI_REPO_DIR/functions" )
fi
It appears that OMZ is adding $ZUI_REPO_DIR to fpath before it actually loads the plugin. This subsequently causes test no. 2,
"${fpath[(r)$ZUI_REPO_DIR]}"!= $ZUI_REPO_DIR`
to fail, and $ZUI_REPO_DIR/functions does not get added to fpath.
This theory is borne out by the fact that bypassing OMZ's plugin loading, by sourcing ZUI directly in .zshrc, solves the problem.
Resolution:
It seems that OMZ automatically adds each plugin directory to fpath before the plugin is actually loaded. This, of
course, clashes with ZUI's method of determining if its function path should be added to fpath for non-ZI plugin managers.
I notice that ZBrowse does not use the same method to test if its functions directory should be added to fpath. Perhaps ZUI could be modified to use the same method, or include a check specifically based on the way Oh My Zsh's deals with plugin directories being added to fpath.
FYI:
The Code of Conduct link is dead
Self-service
I'd be willing to address this documentation request myself.
The text was updated successfully, but these errors were encountered:
duggum
added
bug 🐞
Inconsistencies or issues which will cause a problem for users or implementors.
triage 📑
The issue is awaiting investigation.
labels
Dec 18, 2023
… and zui.plugin.zsh
Breaking change:
Enable ZUI demos only if ZUI[DEMOS] is set, i.e.: typeset -A ZUI; ZUI[DEMOS]=1
This change updates variable and function names in the files stdlib.lzui, utillib.lzui, and zui.plugin.zsh. The updates include changing the names from using underscores to using hyphens, following a more consistent naming convention throughout the codebase.
By updating the names, the codebase becomes more readable and adheres to best practices. This change also improves maintainability, as the code is now more self-explanatory. There are no significant consequences or considerations resulting from this change.
Resolves: #4
Signed-off-by: Salvydas Lukosius <[email protected]>
ss-o
linked a pull request
Dec 19, 2023
that will
close
this issue
Environment
Ubuntu 24.04 on Windows 10 WSL using zsh 5.9 with Oh My Zsh plus ZBrowse and ZUI plugins
Reproduction steps
zbrowse
andzui
to OMZ's plugins array in.zshrc
omz reload
crtl+b
to launch ZBrowseNote: I tested this with AND without other OMZ plugins being loaded and the behaviour was the same.
Expected behavior
Current behavior
Pressing
ctrl+b
to launch ZBrowse results in the following error:zbrowse:482: zui-event-loop: function definition file not found
Code snippet
From
.zshrc
Additional information
First of all, I realize this may very well be an issue with Oh My Zsh. If that is the case, please let me know and I will go there for resolution. I am not a zsh expert and my experience is limited to using it as my shell with OMZ.
Workaround:
A workaround for this issue is to load ZUI directly, per the Standalone installation instuctions. Placing
source {where-zui-is}/zui.plugin.zsh
in my
.zshrc
file yields a successful result.Details:
When loading ZUI as a plugin via OMZ, ZUI's functions directory (
$ZUI_REPO_DIR/functions
) is not added to thefpath
array.The failure appears to happen due to the following code block (
zui.plugin.zsh
lines 26-31):It appears that OMZ is adding
$ZUI_REPO_DIR
tofpath
before it actually loads the plugin. This subsequently causes test no. 2,to fail, and
$ZUI_REPO_DIR/functions
does not get added tofpath
.This theory is borne out by the fact that bypassing OMZ's plugin loading, by sourcing ZUI directly in
.zshrc
, solves the problem.Resolution:
It seems that OMZ automatically adds each plugin directory to
fpath
before the plugin is actually loaded. This, ofcourse, clashes with ZUI's method of determining if its function path should be added to
fpath
for non-ZI plugin managers.I notice that ZBrowse does not use the same method to test if its functions directory should be added to
fpath
. Perhaps ZUI could be modified to use the same method, or include a check specifically based on the way Oh My Zsh's deals with plugin directories being added tofpath
.FYI:
The Code of Conduct link is dead
Self-service
Have you read the Contributing Guidelines?
Are you familiar with the Contributor Covenant Code of Conduct?
Contact Details
No response
The text was updated successfully, but these errors were encountered: