Skip to content

install: skip zsh integration when binary lacks --init - #7

Closed
emarref wants to merge 1 commit into
mainfrom
fix/install-init-guard
Closed

install: skip zsh integration when binary lacks --init#7
emarref wants to merge 1 commit into
mainfrom
fix/install-init-guard

Conversation

@emarref

@emarref emarref commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Problem

Running the curl installer then source ~/.zshrc (or opening any new terminal) hangs indefinitely.

Root cause

The published release v0.1.0-beta.1 predates the shell-integration feature. The tag points at 291e82f, but --init zsh and the eval "$(maic --init zsh)" line in install.sh were both added later in 2a9eb22.

So:

  1. install.sh (current main) writes eval "$(maic --init zsh)" into ~/.zshrc.
  2. The downloaded binary is the old beta with no --init flag, so it treats --init zsh as a plain-English task and asks the on-device model.
  3. The model returns a command to start a zsh (zsh -i / zsh --init).
  4. 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 the eval into ~/.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 behind main.

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
emarref force-pushed the fix/install-init-guard branch from 5e49c08 to 71017f1 Compare July 27, 2026 21:56
@emarref

emarref commented Jul 27, 2026

Copy link
Copy Markdown
Owner Author

No point in this one. I'll just cut a new release.

@emarref emarref closed this Jul 27, 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.

1 participant