Page 1 of 1
SOLVED - Terminal Auto-Complete Function Not Working
Posted: Wed Apr 15, 2020 10:46 am
by stevedude
Not sure when this happened, but I cannot use the auto-complete function [TAB key] to auto complete certain commands, IE: If I want to auto complete 'sudo apt-install', if I type 'sudo apt-ins' then hit TAB, nothing happens. I had this ability beforehand and I've checked my packages thinking maybe I am missing something, but I think I should be all set (Refer to screenshot).
I also did a
Code: Select all
sudo apt-install --reinstall bash-completion
, but that did not help either. Any suggestions? ~Thanks
BASH_Completion.png
Re: Terminal Auto-Complete Function Not Working
Posted: Wed Apr 15, 2020 10:52 am
by dolphin_oracle
apt-install isn't a command
apt install
or
apt-get install
Re: Terminal Auto-Complete Function Not Working
Posted: Wed Apr 15, 2020 10:58 am
by eriefisher
It should be:
or
no "-" in the first example. I think there was no auto completion because it didn't have anything to auto complete since the command was wrong. Is it just apt you have trouble with?
Normally if you enter a partial command and tab, you may not get a response. If there are several responses available a second tab will give you the options.
Re: Terminal Auto-Complete Function Not Working
Posted: Wed Apr 15, 2020 3:16 pm
by stevedude
Sorry - Bad example.
If I type apt ins for apt install, hitting tab does not work. If I type apt-get ins and hit tab, that does not autocomplete either. I can't recall a specific example, but autocomplete does not work with apt commands or anything else.
Re: Terminal Auto-Complete Function Not Working
Posted: Wed Apr 15, 2020 3:21 pm
by dolphin_oracle
have you a custom ~/.bashrc file? or one that might be held over from a different os?
there should be a line like this in your ~/.bashrc that sources the bash-completion libraries.
Code: Select all
# 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 [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
Re: Terminal Auto-Complete Function Not Working
Posted: Wed Apr 15, 2020 6:03 pm
by Head_on_a_Stick
Are we sure this is bash?
Re: SOLVED - Terminal Auto-Complete Function Not Working
Posted: Wed Apr 15, 2020 9:41 pm
by stevedude
Thank you @dolphin_oracle
I copied your text into my bashrc file. The only text it contained was:
Code: Select all
source /usr/share/defaults/etc/profile
Not sure what may have changed my file, I didn't customize it or anything, but that is neither here-nor-there now.
After copying your code example, auto-complete now works with various commands and application names.
Appreciate everyone's time.