install: skip zsh integration when binary lacks --init - #7
Closed
emarref wants to merge 1 commit into
Closed
Conversation
A binary that predates the shell integration (e.g. the v0.1.0-beta.1 release) treats `--init zsh` as a plain-English task and asks the model, which returns something like `zsh -i`. `eval "$(maic --init zsh)"` then launches a nested interactive shell that hangs every new shell forever. Probe the installed binary for the integration's sentinel line before wiring the `eval` into ~/.zshrc; skip with an upgrade hint otherwise, so a version mismatch can never poison the user's shell.
emarref
force-pushed
the
fix/install-init-guard
branch
from
July 27, 2026 21:56
5e49c08 to
71017f1
Compare
Owner
Author
|
No point in this one. I'll just cut a new release. |
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 the curl installer then
source ~/.zshrc(or opening any new terminal) hangs indefinitely.Root cause
The published release
v0.1.0-beta.1predates the shell-integration feature. The tag points at291e82f, but--init zshand theeval "$(maic --init zsh)"line ininstall.shwere both added later in2a9eb22.So:
install.sh(currentmain) writeseval "$(maic --init zsh)"into~/.zshrc.--initflag, so it treats--init zshas a plain-English task and asks the on-device model.zsh -i/zsh --init).eval "$(…)"runs it, launching a nested interactive shell that waits for input forever — every new shell hangs.Fix
Probe the installed binary for the integration's sentinel line (
# maic shell integration (zsh)) before wiring theevalinto~/.zshrc. If the binary is too old, skip the block and print an upgrade hint. A version mismatch can no longer poison the user's shell.Verified: syntax OK; against the old beta binary the installer correctly chooses SKIP.
Follow-up (not in this PR)
The integration still won't function until a release built from
main(which contains--init) is published. The current tag is behindmain.