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

Issue w/ autocomplete on zsh #74

Open
1 task done
yoland68 opened this issue May 20, 2024 · 2 comments
Open
1 task done

Issue w/ autocomplete on zsh #74

yoland68 opened this issue May 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@yoland68
Copy link
Member

Describe the bug
When I run comfy --install-completion or comfy --install-completion zsh, the command inject the following into the zshrc and ~/.zfunc/

autoload -Uz compinit
zstyle ':completion:*' menu select
fpath+=~/.zfunc

~/.zfunc/_comfy

#compdef comfy

_comfy_completion() {
  eval $(env _TYPER_COMPLETE_ARGS="${words[1,$CURRENT]}" _COMFY_COMPLETE=complete_zsh comfy)
}

compdef _comfy_completion comfy

However, it doesn't actually autocomplete even after restarting the terminal

Expected behavior
Autocomplete

Nice to have

  • Screenshots
Screenshot 2024-05-20 at 4 38 27 PM

TAB

Screenshot 2024-05-20 at 4 38 39 PM
@yoland68 yoland68 added the bug Something isn't working label May 20, 2024
@yoland68 yoland68 self-assigned this May 20, 2024
@yoland68
Copy link
Member Author

Interestingly, if I run . ~/.zshrc it works
Screenshot 2024-05-20 at 4 37 22 PM

@yoland68
Copy link
Member Author

Or if I do the following in zshrc, it also works:

autoload -Uz compinit

# Define custom completion for comfy
# Ensure that _comfy_completion is defined after compinit
_comfy_completion() {
  eval $(env _TYPER_COMPLETE_ARGS="${words[1,$CURRENT]}" _COMFY_COMPLETE=complete_zsh comfy)
}

# Bind the completion function to the comfy command
compdef _comfy_completion comfy

# Other configurations (e.g., aliases, prompt, etc.)
zstyle ':completion:*' menu select

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant