yarn-completion: Does not automplete after colon

If I have the following scrips in my package.json:

scripts: {
dev:something: ",,.,,"
dev:another: "...."
}

When I type dev:s and press tab does not autocomplete dev:something

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 41 (24 by maintainers)

Most upvoted comments

You’re right! My bash --version on macOS was saying:

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
Copyright (C) 2007 Free Software Foundation, Inc.

After brew install bash and opening a new terminal, I got:

GNU bash, version 4.4.19(1)-release (x86_64-apple-darwin17.3.0)
Copyright (C) 2016 Free Software Foundation, Inc.

Although I still don’t see any output in bind -v | grep skip, autocompletion after : works!

That could be.

I’m using 3.2.57(1)-release (macOS Sierra 10.12.6)

Adding this to my .bash_profile fixed it for me

COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

I was able to fix this by adding

export COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

in my .bash_profile after all bash completions were setup.

I’m running bash 5.x and bash_completions 2.x.

@kachkaev Glad to hear.

Make sure you follow the instructions that homebrew prints out after installing (related to changing your login shell) so that the changes persist through logins/logouts.

Otherwise, you’ll be back with bash 3 next time you log in.

Cool… I’ll take a look a bit later.

This is kind of a hail mary, so no promises that I actually turn up with something.

Can it be that a fix requires export COMP_WORDBREAKS=... instead of just COMP_WORDBREAKS=...?

v0.5.1 should work now without having to adjust your system’s globally set COMP_WORDBREAKS variable.

@cdeutsch Good to know. Thanks for posting your solution.

Also highly recommended:

$ brew install bash (and then follow the prompts to set as your login shell, e.g. $ chsh -s /path/to/bash4 yourusername)

Also unrelated but highly, highly recommended:

Replace those pesky BSD utils with their GNU counterparts: https://apple.stackexchange.com/a/69332