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

Heroku CLI Autocomplete does not respect $ZSH_COMPDUMP location for zsh. #1956

Open
superatomic opened this issue Mar 6, 2022 · 2 comments

Comments

@superatomic
Copy link

superatomic commented Mar 6, 2022

Do you want to request a feature or report a bug?

This is a bug report.

  • Heroku version: heroku/7.59.2 darwin-x64 node-v12.21.0
  • OS: macOS Monterey 12.2.1

What is the current behavior?

After installing Heroku CLI Autocomplete by running heroku autocomplete and following the install instructions, a .zcompdump file will be created at $ZDOTDIR every time .zshrc is run, or at $HOME if $ZDOTDIR is not set.

This is because no -d option is given in ~/Library/Caches/heroku/autocomplete/zsh_setup (macOS), which is a file that is created by create.ts when running heroku autocomplete.

autoload -Uz compinit;
compinit;

What is the expected behavior?

If the environment variable $ZSH_COMPDUMP is set, the .zcompdump file should be created there instead of $ZDOTDIR or $HOME.

So if $ZSH_COMPDUMP exists, compinit -d "$ZSH_COMPDUMP"; should run instead of just compinit;.

A potential implementation for a fix would be replacing line 229 in with the following check:

if [[ -z "$ZSH_COMPDUMP" ]]; then
    compinit;
else
    compinit -d "$ZSH_COMPDUMP";
fi

This would not change any behavior for anyone without $ZSH_COMPDUMP set, and respects $ZSH_COMPDUMP for those who do.

superatomic added a commit to superatomic/dotfiles that referenced this issue Mar 6, 2022
Heroku autocomplete needs to be left off until heroku/cli#1956 is resolved. For now, it is being added as a comment.
@superatomic
Copy link
Author

I can submit a pull request with the proposed changes if that would be useful.

@k80bowman
Copy link
Contributor

Internal work item

I confirmed that the code highlighted here remains unchanged, this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants