ublue-os / toolboxes

Centralized repository of containers designed for Toolbox/Distrobox
Apache License 2.0
63 stars 14 forks source link

homebrew bash_completions not sourced #39

Closed aussielunix closed 9 months ago

aussielunix commented 9 months ago

I am using a bluefin-cli distrobox using this quadlet
Homebrew drops it's bash_completions into $HOME/.local/share/bluefin-cli/.linuxbrew/etc/bash_completion.d/

These are never sourced.

To test:

distrobox enter bluefin
brew install kubectl
# exit / enter back into container
kubectl <tab><tab> # does not work

For a workaround I have dropped this into my ~/.bashrc

# Homebrew specific bash completions
if [[ -n "$CONTAINER_ID" ]]; then
  if [ -d $HOME/.local/share/bluefin-cli/.linuxbrew/etc/bash_completion.d ]; then
    for rc in $HOME/.local/share/bluefin-cli/.linuxbrew/etc/bash_completion.d/*; do
      if [ -r "$rc" ]; then
        . "$rc"
      fi
    done
    unset rc
  fi
fi
aussielunix commented 9 months ago

image

Pasting here as part of a reminder