feat: Release completions as a tarball and validate loaded scripts - #597
Merged
Conversation
Release the shell completion loaders as one seam-completions-v<version>.tar.gz asset instead of three bare files, and source the seam-bin AUR package from the tarball. The versioned name also removes the need to rename the sources in the PKGBUILD. Harden the loaders: evaluate the output of 'seam completion' only when it starts with the exact first line the script generator produces. A seam without the completion command prints other things, e.g., 'Not logged in. Please run "seam login"', which the fish loader piped into source and fish reported as 'Unknown command: Not'. Nothing the CLI prints other than a completion script is ever evaluated now, and a test pins the sentinel lines to the generator output so they cannot drift apart. Document what each shell needs before installed completions appear: bash reads them via the bash-completion package, and zsh caches its completion functions in ~/.zcompdump, which frameworks calling compinit -C never rebuild on their own. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016eYkGybhEJJE3FkaqXdwLv
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.
Follow-up to #594.
Summary
seam-completions-v<version>.tar.gzasset instead of three bare files, and source theseam-binAUR package from that tarball. The versioned filename also removes the need to rename the sources in the PKGBUILD.seam completion <shell>is evaluated only when it starts with the exact first line the script generator produces. This fixes the reported fish failure, where aseamwithout thecompletioncommand printedNot logged in. Please run "seam login"to stdout and the loader piped it intosource(fish: Unknown command: Not). Nothing the CLI prints other than a completion script is ever evaluated now.bash-completionpackage, and zsh caches its completion functions in~/.zcompdump, which frameworks callingcompinit -Cnever rebuild on their own. Fish needs nothing extra.Verification
seamthat printsNot logged inand exits 0: no errors, nothing evaluated, shells degrade to their default completion._build.ymland makepkg run them.🤖 Generated with Claude Code
https://claude.ai/code/session_016eYkGybhEJJE3FkaqXdwLv
Generated by Claude Code