I'm trying to set up my zsh terminal environment on my M2 MacBook Air

I'm trying to set up my zsh terminal environment on my brand new M2 Air. I'm following the instructions at the below page:

https://scriptingosx.com/2019/07/moving-to-zsh-part-5-completions/


I'm trying to add tab autocompletion, but everywhere I read I need to run autoload -Uz compinit && compinit first. When I run those commands from the command line they work and I can use tab autocomplete, but when I run them from .zshrc I get the error "command not found: compinit\u2029" as per attached screenshot


I noticed someone else posted a related issue, but the trail went cold.

"complete:13: command not found: compdef"… - Apple Community


Can you help me get rid of this error and run compinit from my .zshrc ?


[Edited by Moderator]

MacBook Air

Posted on Aug 14, 2022 1:18 PM

Reply

Similar questions

3 replies

Aug 15, 2022 8:55 AM in response to wsa225

Sounds like you don't have the proper path variable configured. I don't use zsh, so I cannot advise on that, but it is usually best to put the full path to any commands into your shell configuration files and regular scripts so you know you exactly which version of the utility you are accessing since it is possible to have versions installed from other sources. Best to have it pointing directly your default installed system utilities unless you need to use a customized version.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I'm trying to set up my zsh terminal environment on my M2 MacBook Air

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.