[SOLVED] how is extra/bash_completion supposed to work?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
installed this packages, but
/etc/bash_completion.d/
stays empty
everything is in /usr/share/bash-completion/
and git copmletition in the git doc dir?
do I need to copy all files self to /etc/bash_completion.d/ ?
could this not be something that just work on Slackware?
well, it actually just works, I'm using it: maybe you have just to logout and login again (or source /etc/profile), check /etc/profile.d/bash_completion.sh
the directory /etc/bash_completion.d/ is for the third-party completion stuff (here it contains the files acroread, libreoffice.sh and youtube-dl.bash-completion).
git is a special case as it doesn't install bash completion stuff in the usual places by default: so yes, if you prefer you can copy its git-completion.bash in /etc/bash_completion.d or ~/.config/bash_completion
Last edited by ponce; 01-07-2017 at 05:31 AM.
Reason: grammar
This is something seen in other packages as well. Typically /usr/ locations are for upstream or distribution supplied files, and then /etc/ locations are for the user to add over override other files. One of the most common packages you see this with is X (/usr/share/X11/xorg.conf.d/ vs /etc/X11/xorg.conf.d/).
1:
it does not work for me if I boot to runleven 4, the output of complete -p is totally empty kde terminal, xfce terminal, terminator,
but not if I log in on a shell via runlevel 3 or switching to a Ctr+Alt+f1 session. but this login ignores my .bashrc
shouldn't a login always run the global profile, why is my x session ignoring that?
what is the correct setup? starting each shell as login shell and sourcing .bashrc in .profile?
2:
not all software assumes that bash completion is available and puts therefore config files somewhere else.
for example git, the useful stuff is in /usr/doc/git-2.9.0/contrib/completion/
this is not good, if I would for example like to add bash completion to sbbdep, I could not assume that bash completion is active and would also have to deliver my completion files in the doc folder?
should in 2017 bash completion not be available per default?
shouldn't a login always run the global profile, why is my x session ignoring that?
it depends on how you initialize your shells but yes, a login shell should read /etc/profile (see "man bash" in the "INVOCATION" section).
Quote:
what is the correct setup?
there's not actually a "correct" setup, there are multiple choices.
Quote:
starting each shell as login shell and sourcing .bashrc in .profile?
in my terminals I do like that.
Quote:
not all software assumes that bash completion is available and puts therefore config files somewhere else.
for example git, the useful stuff is in /usr/doc/git-2.9.0/contrib/completion/
this is not good, if I would for example like to add bash completion to sbbdep, I could not assume that bash completion is active and would also have to deliver my completion files in the doc folder?
should in 2017 bash completion not be available per default?
this depends mostly on how upstream decide to do things: if the bash_completion stuff is installed by the "make install" in the usual places then it's available by default, if upstream decides to put it in a contrib directory then it's there where you most probably will find it when packaged.
if you decide that your completion file for sbbdep has to be available by default to whoever has bash_completion enabled, IMHO, the right place where "make install" has to put it is /usr/share/bash-completion/completions
thanks, need to write a blog entry for that since I tend to forget from one fresh install to an other.
/etc/profiled.d stuff is invoked also in the various terminals, but all the alias stuff disappears (that's why export -f should be preferred over alias). I am unsure how often I have already learned that now :-)
but, the git situations is still less than optimal...
edit: and why . /usr/share/bash-completion/bash_completion
does this mean this will be ignored/
decided to source the stuff in .bashrc,
/etc/profile/d/bash_completion.sh and extra some of the aliases of coreutils-dircolors.sh
since this will make all terminal applications work out of the box, without customizing the shell command to `bash -l`
thanks for the help!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.