4

I'm using a Chromebook (with a developer mode enabled), and as someone of you may know, there is no write access to the system directories (including /etc/).

I'd like to enable the bash-completion option for the local user without adding any files to /etc, while I have an write access to /home and /use/local directories only.

How can I enable bash-completion in this case?

Thank you.

PS. ChromeOS is Gentoo-based, this information might be useful for someone.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
ihor_dvoretskyi
  • 4,278
  • 2
  • 14
  • 15

2 Answers2

4

bash-completion is enabled by sourcing a shell script—it sits at /usr/share/bash-completion/bash_completion on my Debian box, for example—but you can put it wherever. It looks in its own directory for the completions to load.

Completions used to go in /etc/bash_completion.d, but that's now a backwards compatibility directory and can be changed by setting $BASH_COMPLETION_COMPAT_DIR before sourcing the script.

You should be able to grab it from its home on Github and install it to /usr/local or $HOME.

Faheem Mitha
  • 34,649
  • 32
  • 119
  • 183
derobert
  • 107,579
  • 20
  • 231
  • 279
  • You might want to have a look at [~/.bash_completion.d/](https://serverfault.com/a/831184) and this [addendum](https://serverfault.com/a/915618) – Gen.Stack Dec 08 '18 at 20:00
-1

As far as I can tell, bash completion has been disabled in ChromeOS and there is no way to enable it.

See Chromium Bug Report