Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
es80 opened this issue Jul 30, 2020 · 2 comments
Labels
enhancement upstream v0.12 Issues (primarily bugs) reported against v0.12 releases

Comments

@es80
Copy link

es80 commented Jul 30, 2020

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

@alisdair
Copy link
Member

Thanks for reporting this! This is a missing feature in an upstream library we use, posener/complete. There is an existing pull request which I believe would address this, but it needs some support from someone to get it over the line.

@alisdair alisdair added the v0.12 Issues (primarily bugs) reported against v0.12 releases label Jul 30, 2020
@danieldreier danieldreier added new new issue not yet triaged enhancement and removed new new issue not yet triaged labels Aug 5, 2020
@brandondrew
Copy link

wow... this should be relatively simple to fix. If I'm not mistaken it's just a matter of looking in the right place, which I believe should be

${ZDOTDIR:-~}/.zshrc

This 👆 defaults to ~ if $ZDOTDIR is not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement upstream v0.12 Issues (primarily bugs) reported against v0.12 releases
Projects
None yet
Development

No branches or pull requests

4 participants