The officially official Devuan Forum!

You are not logged in.

#1 2020-11-09 11:36:44

devian
Member
Registered: 2019-11-08
Posts: 13  

bash-completion not enabled by default after installation

As title, I've installed bash-completion and finding that it does not do autocomplete with git. e.g.

git chec***tab***

Then nothing. Same for

apt-get inst***tab***

I note that this is solved by doing

. /usr/share/bash-completion/completions/git

or

. /etc/bash_completion

but why is this not setup by default when you install the bash-completion package? Surely one of these scripts should automatically be run when opening bash?

Last edited by devian (2020-11-09 11:37:32)

Offline

#2 2020-11-10 17:08:11

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,143  
Website

Re: bash-completion not enabled by default after installation

Does it work if you log in to the console (TTY) screen?

EDIT: un-comment the section in ~/.bashrc (for just your user) or /etc/bash.bashrc (for all users).

Last edited by Head_on_a_Stick (2020-11-10 17:11:02)


Black Lives Matter

Offline

#3 2020-11-10 17:15:30

devian
Member
Registered: 2019-11-08
Posts: 13  

Re: bash-completion not enabled by default after installation

Yes, if I ctrl-alt-f1, login and try tabbing out commands then completion works fine.

Uncomment which section?

Thanks

Offline

#4 2020-11-10 17:22:03

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,143  
Website

Re: bash-completion not enabled by default after installation

devian wrote:

Yes, if I ctrl-alt-f1, login and try tabbing out commands then completion works fine.

It doesn't work on the desktop because SLiM doesn't read ~/.profile or /etc/profile{,.d/*}.

devian wrote:

Uncomment which section?

This bit:

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

Black Lives Matter

Offline

#5 2020-11-10 17:30:13

devian
Member
Registered: 2019-11-08
Posts: 13  

Re: bash-completion not enabled by default after installation

I don't have that in my .profile file. Should I have it in there do you think?

I did

apt-get install --reinstall bash-completion

but there is still nothing in .profile.

Offline

#6 2020-11-10 17:40:49

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,143  
Website

Re: bash-completion not enabled by default after installation

devian wrote:

there is still nothing in .profile.

I wrote:

un-comment the section in ~/.bashrc


Black Lives Matter

Offline

#7 2020-11-10 17:46:45

devian
Member
Registered: 2019-11-08
Posts: 13  

Re: bash-completion not enabled by default after installation

I do not have anything related to bash-completion in my .profile or .bashrc

I note that on Debian it does automatically insert the code you quoted into .bashrc when you install the package.

What a strange issue...

Offline

#8 2020-11-10 17:55:23

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,143  
Website

Re: bash-completion not enabled by default after installation

devian wrote:

I do not have anything related to bash-completion in my .profile or .bashrc

How about in /etc/skel/.bashrc? It should be the final stanza in that file and that file should be copied to $HOME when your user is created.

devian wrote:

I note that on Debian it does automatically insert the code you quoted into .bashrc when you install the package.

I don't think so.


Black Lives Matter

Offline

#9 2020-11-10 18:07:58

devian
Member
Registered: 2019-11-08
Posts: 13  

Re: bash-completion not enabled by default after installation

Yes, the bash-completion setup code exists in /etc/skel/.bashrc. I created a new user and yes, the correct code is in their bashrc.

I admit defeat - all I will say is I think that these issues arose because I have been using Devuan for a while so gone through at least one upgrade cycle.

Is it possible that in the previous major release of Devuan these problems I mentioned were present and have been carried across to my current setup?

Offline

#10 2020-11-10 18:11:01

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,143  
Website

Re: bash-completion not enabled by default after installation

devian wrote:

Is it possible that in the previous major release of Devuan these problems I mentioned were present and have been carried across to my current setup?

It's certainly possible that the bash-completion package worked differently in the past and so your old ~/.bashrc doesn't work with it now.


Black Lives Matter

Offline

#11 2020-11-10 18:12:40

devian
Member
Registered: 2019-11-08
Posts: 13  

Re: bash-completion not enabled by default after installation

It's certainly possible that the bash-completion package worked differently in the past and so your old ~/.bashrc doesn't work with it now.

Okay, let's go with that then. Even Debian has issues when you upgrade between versions as opposed to doing an installation from fresh.

Offline

Board footer