ublue-os / toolboxes

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

homebrew bash_completions not sourced #39

Closed aussielunix closed 5 months ago

aussielunix commented 5 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 5 months ago

image

Pasting here as part of a reminder