Skip to content

'terraform -install-autocomplete' fails to respect zsh environment variable 'ZDOTDIR' #25704

@es80

Description

@es80

Terraform Version

Terraform v0.12.29 

Terraform Configuration Files

Debug Output

Crash Output

Expected Behavior

terraform -install-autocomplete for zsh ought to add lines to my .zshrc by finding the location of that file. It assumes the location is ~/.zshrc whereas the location depends on whether the environment variable ZDOTDIR is set.

Actual Behavior

$ terraform -install-autocomplete
Error executing CLI: Did not find any shells to install 

Steps to Reproduce

  1. Set ZDOTDIR and move .zshrc accordingly, restart shell and ensure .zshrc has been read OK.
  2. terraform -install-autocomplete

Additional Context

Of course it's easy to work around this issue by creating a new file ~/.zshrc, running terraform -install-autocomplete, appending the contents of ~/.zshrc to $ZDOTDIR/.zshrc then deleting ~/.zshrc.

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions