You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
init.zsh silently skips the proxy when ghost-complete isn't on PATH yet (Homebrew shellenv later in .zshrc); doctor reports healthy #242
After brew install StanMarek/tap/ghost-complete + ghost-complete install, new Ghostty tabs started without the proxy. Autocomplete only worked after running source ~/.zshrc by hand. ghost-complete doctor reported everything as OK.
Cause: the ghost-complete initialize block sits at the top of .zshrc, and shell/init.zsh only execs the proxy when command -v ghost-complete succeeds (lines 88 and 126). On Apple Silicon, /opt/homebrew/bin is usually added by eval "$(/opt/homebrew/bin/brew shellenv)", which often lives later in .zshrc (my case) instead of .zprofile. When the init block runs, the binary is not on PATH, command -v fails, and init does nothing without printing anything. A manual source ~/.zshrc runs with the full PATH, so the proxy starts then. That makes the problem look intermittent and hard to diagnose.
In an affected tab, echo $GHOST_COMPLETE_ACTIVE was empty and the shell's parent was /usr/bin/login, not ghost-complete.
Workaround: put eval "$(/opt/homebrew/bin/brew shellenv)" at the top of ~/.zprofile.
Suggestions:
Have ghost-complete install write the absolute path of the binary into the init block (or into init.zsh), so startup doesn't depend on PATH order.
Or print a one-line warning when the terminal is supported but ghost-complete is not on PATH.
Have doctor check this case. It ran from an already-fixed shell, so it reported "shell integration looks healthy". It could run something like env -i HOME=$HOME $SHELL -lic 'command -v ghost-complete', or compare the parent process.
This seems related to the startup work in #186, but I didn't see the PATH case mentioned there.
Steps to reproduce
On Apple Silicon, install via Homebrew and run ghost-complete install.
Keep eval "$(/opt/homebrew/bin/brew shellenv)" in .zshrcbelow the ghost-complete initialize block, with nothing in .zprofile adding /opt/homebrew/bin.
Quit Ghostty and open a new window.
Observe that there is no popup and echo $GHOST_COMPLETE_ACTIVE is empty. After source ~/.zshrc, the popup works.
Expected behavior
The proxy should start in every new tab, or ghost-complete should warn that it couldn't find its binary. doctor should flag the problem.
Activity