Skip to content

fix: support fish completion script - #41418

Closed
Skylvw wants to merge 1 commit into
anomalyco:devfrom
Skylvw:fix/completion-fish
Closed

fix: support fish completion script#41418
Skylvw wants to merge 1 commit into
anomalyco:devfrom
Skylvw:fix/completion-fish

Conversation

@Skylvw

@Skylvw Skylvw commented Aug 9, 2026

Copy link
Copy Markdown

Fixes #41232.

yargs 18 only ships bash/zsh completion templates and its built-in \completion\ command picks the template from , ignoring the shell positional argument — so \opencode completion fish\ emitted a bash/zsh script.

Handle an explicit shell positional ourselves before yargs parses: if \completion\ is called with a known shell (bash/zsh/fish), print the right script and exit. Templates for bash/zsh come from yargs main; fish from yargs' fish template.

Verified: \completion fish|zsh|bash\ each emit the correct script; bare \completion\ falls through to yargs as before. 4 unit tests in packages/opencode/test/cli/completion.test.ts pass.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

This PR appears to address the same issue. Both PRs are focused on handling shell completion scripts properly (bash/zsh/fish) and the current PR #41418 directly references issue #41232 which PR #41235 likely also addresses. The titles suggest they're tackling the same root cause: ensuring the shell argument is properly honored in the completion command.

You should verify if PR #41235 is already merged or if these should be consolidated.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 9, 2026
@github-actions github-actions Bot closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode completion fish emits bash/zsh script, not fish syntax

1 participant