-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
Cannot use zr
or zrf
without autocompleting zellij
command once
#1933
Comments
I'm currently seeing the same behaviour. I also tried
I believe adding the completions file inside |
I have the same issue as @citypaul. I've dumped the Zellij zsh completion into a separate file and sourced it in my |
I also have the same issue. I was able to find a workaround that got me the functionality I was looking for originally, it does not address the bug here but it will get rid of the warning if you are just looking to use the functions. I just deleted everything in the completions and left the functions. #compdef zellij
function zr () { zellij run --name "$*" -- zsh -ic "$*";}
function zrf () { zellij run --name "$*" --floating -- zsh -ic "$*";}
function ze () { zellij edit "$*";}
function zef () { zellij edit --floating "$*";} |
This is also an issue in The fish shell has user completions in If completions are saved as In the current (v0.35.2) setup functions aren't loaded until after first attempt of completion. See also: #2186 Edit: Added reference to issue 2186. |
I did the same as @dubst3pp4 and for some reason i get |
Same issue here. if [[ -x "$(command -v zellij)" ]];
then
eval "$(zellij setup --generate-completion zsh | grep "^function")"
fi; |
same issue occurs in 0.38.2 version, I think it make no sense that put alias function in the completion file, they should be seperated into different files |
😂 a bit strange solution, but it really works |
I found this with bash on a Fedora 39 server. My |
Just ran into this, macos + zsh here |
I also ran into this...if so many people are experiencing this, since 2022, shouldn't the docs be editted? Is there some reason no PR is being opened? |
IIRC, we talked about updating docs for this in Discord but since these have to be maintained (keep up-to-date, etc) it was decided to leave them they are until a fix for this is found. I explored this but couldn't find a fix that didn't require splitting completion functions from normal ones: |
I finally got zellij zsh completion to work using the zsh definition using the following workarounds: # 1 Using zsh's native Apparently the 2022 update of ZSH (currently the latest) had some changes to discourage loading of completion code manully, and favours auto loading when it's needed. However some users (and app maintainers) have founds how to workaround it. The sed below takes care of that. autoload -U +X compinit && compinit
. <( zellij setup --generate-completion zsh | sed -Ee 's/^(_(zellij) ).*/compdef \1\2/' ) # 2 Using autoload -U +X compinit bashcompinit && compinit && bashcompinit
. <( zellij setup --generate-completion bash ) I personally prefer # 1, but in case that stops to work # 2 can be a fallback until things are fixed again. @imsnif could you update the --generate-completion zsh to replace the |
@Lockszmith-GH, thank you for this! I know this may not be the most appropriate place, but I figured I'd leave a comment here in case anybody else like me ends up on this thread too - I've gotten it working with the same method and I've also extended it so that it will tab complete session names for delete-session/d, attach/a, and kill-session/k. A patch for the completions can be found here, if you're like me and you save them to a file. If you want to use a sed command like in the comment above, you can use either of the following:
|
Basic information
zellij --version
: 0.32.0stty size
: 34 72uname -av
:6.0.6-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sat Oct 29 14:21:50 UTC 2022 x86_64 GNU/Linux
alacritty --version
: alacritty 0.11.0omz version
: master(fb66b67)
Minimal
.zshrc
:Further information
Setup: Placing completions file generated from
zellij setup --generate-completion zsh
inside$fpath
(I'm usingoh-my-zsh
in this case)Expected behavior: zellij commands such as
zr
,zrf
should work out of the boxActual behavior:
zsh: command not found: zr
etc. errorWorking attempt: I have to autocomplete zellij once by typing
zellij<space><tab>
orzell<tab><tab>
(When you seeaction
,attach
,convert-layout
, etc. arguments). Only after this am I able to runzr
orzrf
.The text was updated successfully, but these errors were encountered: