fix(cli): zsh completion _arguments error and compinit registration failure - #19441
Closed
0xbboyd wants to merge 1 commit into
Closed
fix(cli): zsh completion _arguments error and compinit registration failure#194410xbboyd wants to merge 1 commit into
0xbboyd wants to merge 1 commit into
Conversation
The generated zsh completion script ended with _hermes "$@", which gets executed at eval time (shell init) outside any completion context, causing _arguments:comparguments:327: can only be called from completion function on every new shell session. Additionally, the #compdef hermes directive is only processed by compinit when loaded from a file in fpath, not when eval'd as a string. This means eval "$(hermes completion zsh)" silently fails to register completions. Fixes: - Remove trailing _hermes "$@" call from generate_zsh() output - Update installation comment to recommend file-based approach Fixes NousResearch#19439 Co-authored-by: hermes-claude-sonnet-4 <hermes-claude-sonnet-4@users.noreply.github.com>
Collaborator
Collaborator
|
Overlaps with existing fix PRs |
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
eval "$(hermes completion zsh)"in~/.zshrcproduces two bugs:_arguments:comparguments:327: can only be called from completion function— The generated zsh script ends with_hermes "$@", which executes outside any completion context at shell init time, triggering_argumentserrors on every new terminal.Completions never register — The
#compdef hermesdirective at the top of the output is only processed bycompinitwhen reading files fromfpath, not when eval-'d as a string. Soeval "$(hermes completion zsh)"silently fails to set up completions.Fix
_hermes "$@"fromgenerate_zsh()output. The completion function should only be invoked by zsh's completion system, not at definition time.Testing
Verified locally that
generate_zsh()output:}}(function close), not_hermes "$@"#compdef hermesdirectivefpathevalin the installation instructionsFixes #19439
Platforms tested