Skip to content

.zshrc not correct autofilled when installing using brew on macos. #35450

@artiphishle

Description

@artiphishle

Terraform Version

Terraform v1.5.7
on darwin_arm64

Your version of Terraform is out of date! The latest version
is 1.9.2. You can update by downloading from https://www.terraform.io/downloads.html

Issue & Solution proposal

It's not possible to source ~/.zshrc anymore due to:

complete:13: command not found: compdef

The solution like mentioned in the stackoverflow link at the bottom to add this line missing:

autoload -Uz compinit && compinit

The whole .zshrc content should therefore be:

autoload -Uz compinit && compinit # this one was missing
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /opt/homebrew/bin/terraform terraform

https://stackoverflow.com/questions/66338988/complete13-command-not-found-compdef

Steps to Reproduce

  1. Install terraform using brew
  2. Install terraform autocomplete (maybe optional)
  3. source ~/.zshrc (or open new terminal)

Additional Context

just figured that my terraform isn't up-to-date, so the current version isn't available by installing using brew? Just installed 30mins ago, therefore expecting a new version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions