$ time . /etc/bash_completion real 0m0.774s user 0m0.473s sys 0m0.037s
This is with a hot cache. And happens everytime you start a shell (see /etc/bash.bashrc)
Is there a way to speed this up? I thought there was a bugticket about this at some point, but couldn't find it back.
I thought there was a trick like loading only completion files for stuff you actually use, but google isn't very helpful.
For now I'm experimenting with backgrounding sourcing the completion, which seems to work.
edit: backgrounding doesn't seem to work so well after all.
I kept getting `bash: __git_ps1: command not found` (i use this in my $PS1), i thought it was only the first time it would show PS1, but it does it all subsequent times as well.
Last edited by Dieter@be (2010-11-22 23:28:19)
< Daenyth> and he works prolifically
4 8 15 16 23 42
So, now with core/filesystem 2010.12-1, /etc/bash_completion is sourced twice by /etc/profile :
. in /etc/profile.d/bash_completion.sh
. in /etc/bash.bashrc
The workaround is to remove read permission to /etc/profile.d/bash_completion.sh : chmod 0 /etc/profile.d/bash_completion.sh
Given that /etc/bash.bashrc is a file written and provided by Arch, it should be removed from there. This file should never even consider if /etc/bash_completion is on the system. /etc/profile.d/bash_completion.sh is a file provided by upstream (bash-completion) and it should be what provides completion.