The bash_completion script in my .bash_profile script is running slowly, making new terminals very slow to start up. Is it possible to present a shell for running commands, and then source the bash_completion script in the background?
I don't think so, bash_completion depends on some variables being set and if you try to load them on the background (with &) they'll be created on a subshell and not be available on the shell you're runnning.
you can however move those from .bashrc to .bash_profile and then logout, that way they're loaded only once per session but I'm not sure if this would work either since most of those are arrays and afaik those can't be exported.
I suppose you could also try some kind of "caching" that will be ugly but may speed up a bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With