Open wentasah opened 4 years ago
well, it would likely work in other platforms, but indeed will make things slower (depending on your default default .bashrc
)
Maybe, can you try if instead you can just try to ensure that a function defined in /usr/share/bash-completion/bash_completion
(or well yours) exists and in such case source it? Would be that enough?
Otherwise, something else we could probably do for everyone is something like this:
env HOME="/tmp/fooo" DEFAULT_HOME="$HOME" bash -i -c "export HOME=$DEFAULT_HOME; echo do stuff in $HOME"
So that we won't ever end up loading the user's .bashrc
, but we still be using its HOME for other stuff.
Mh, loading the bash_completion is actually already happening, so what I assume is that we're picking the wrong location in your setup. Where is the bash_completion
script?
I assume you've to fix source_bash_completion
function in bash-completions-getter.sh
instead, can you maybe do a PR?
I'm trying to make this work on NixOS and I'm getting the following error:
It seems that when bash is run in non-interactive mode, this function is not defined on NixOS. I can resolve the issue with the following change, but I'm not sure how generic it is and whether it would work on other distributions.