On m1 pro macbook using zsh, was trying to get git autocomplete to work by pasting autoload -Uz compinit && compinit in my .zshrc however I am getting the error compinit:141: parse error: condition expected: $1

$FPATH is not being set in .zshrc so that shouldn't be the issue.

It's clear the problem is with compinit, since when I run just compinit in the shell I get the same error.

  • I've tried to comb through the functions in fpath to find an issue, no luck
  • Tried installing zsh-completion and setting the fpath, no luck
  • Also upgraded zsh from 5.8.1 to 5.9 and manually set the fpath to the corresponding functions, no luck
  • Even left the issue with compinit and tried autoload -Uz vcs_info instead, no luck
1

There are 1 best solutions below

0
On

Solved

The issue was this line in my .zprofile which I thought I had to add after installing posh-git-sh (step 3) [[ -e ~/.zshrc ]] && emulate sh -c 'source ~/.zshrc'

Once I removed it the expected behaviour returned