autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

[git] shell-aliased git aliases don't work

Open clo4 opened this issue 3 years ago • 5 comments

Sanity checks

  • [X] My issue relates to a specific CLI completion spec (e.g. git checkout is missing options in git completion spec). If your issue is more general, please create your issue here: withfig/fig
  • [X] I have searched github.com/withfig/autocomplete/issues and there are no duplicates of my issue
  • [ ] I would like to work on this.

What CLI tool does this relate to?

git

Which statement makes the most sense?

There is a bug with this completion spec

Issue Details

Shell aliases eg. alias a=b don't work when the aliased command is a git alias

  1. Create a git alias, eg. git config --global alias.co checkout
  2. Verify it works
  3. Add an alias to your config: alias gco="git co"
  4. Restart fig
  5. Type gco, observe (no) completions

This might also be an autocomplete-engine problem, not sure

clo4 avatar Feb 25 '22 21:02 clo4

I am also having this issue.

some of my alias's work some don't...


# don't work
alias a=amplify
alias as="a status"
alias apush="a push"
alias apub="a publish"
alias politlyAskFigToRestart="sudo bash ~/projects/scripts/i-love-fig.sh"
alias new_project="bash ~/projects/scripts/new_project.sh"
alias npro=new_project

# works
alias y=yarn

ShawnCockburn avatar Mar 03 '22 14:03 ShawnCockburn

@ShawnCockburn strange - I think you might actually be running into a separate issue. I can reproduce this too

clo4 avatar Mar 04 '22 00:03 clo4

@ShawnCockburn strange - I think you might actually be running into a separate issue. I can reproduce this too

I might be yes, ill make a new issue!

thanks @SeparateRecords

ShawnCockburn avatar Mar 08 '22 22:03 ShawnCockburn

I have an alias alias git="noglob git" setup which Fig doesn't seem to pick up (autocomplete doesn't work at all for the alias). Is that the same issue as this one?

nphmuller avatar Apr 13 '22 07:04 nphmuller

Slightly different, I think the issue is that fig doesn't understand noglob. It sees it as a command, looks up the completion, doesn't find it, then stops completing.

The proper solution to this is to update the parser, the quick solution is to add a noglob command to this repo - I'll do this now as a stopgap solution 🙂 #1147

This issue is specifically that shell aliases eg. alias a=b don't work when the aliased command is a git alias

clo4 avatar Apr 14 '22 05:04 clo4