SOLVED - Terminal Auto-Complete Function Not Working

Message
Author
User avatar
stevedude
Posts: 68
Joined: Sat Aug 11, 2018 8:19 pm

SOLVED - Terminal Auto-Complete Function Not Working

#1 Post 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
You do not have the required permissions to view the files attached to this post.
Last edited by stevedude on Wed Apr 15, 2020 9:37 pm, edited 1 time in total.
OS:MX-19.2_x64|Kernel:4.15.0-1-amd64 x86_64|Xfce 4.14.2|Mobo:TUF X470-PLUS|CPU AMD Ryzen 5, 2600 MHz
Graphics:GeForce GTX 1060,driver:nvidia v:390.77|Audio:NVIDIA snd_hda_intel
Netwrk:Realtek RTL8111|Seagate:ST2000DM006, 1.82 TB|Mem:15.6 GB

User avatar
dolphin_oracle
Developer
Posts: 22245
Joined: Sun Dec 16, 2007 12:17 pm

Re: Terminal Auto-Complete Function Not Working

#2 Post by dolphin_oracle »

apt-install isn't a command

apt install

or

apt-get install
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
eriefisher
Posts: 142
Joined: Fri Sep 07, 2007 8:11 am

Re: Terminal Auto-Complete Function Not Working

#3 Post by eriefisher »

It should be:

Code: Select all

apt install .....
or

Code: Select all

apt-get install ....
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.

User avatar
stevedude
Posts: 68
Joined: Sat Aug 11, 2018 8:19 pm

Re: Terminal Auto-Complete Function Not Working

#4 Post 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.
OS:MX-19.2_x64|Kernel:4.15.0-1-amd64 x86_64|Xfce 4.14.2|Mobo:TUF X470-PLUS|CPU AMD Ryzen 5, 2600 MHz
Graphics:GeForce GTX 1060,driver:nvidia v:390.77|Audio:NVIDIA snd_hda_intel
Netwrk:Realtek RTL8111|Seagate:ST2000DM006, 1.82 TB|Mem:15.6 GB

User avatar
dolphin_oracle
Developer
Posts: 22245
Joined: Sun Dec 16, 2007 12:17 pm

Re: Terminal Auto-Complete Function Not Working

#5 Post 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
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
Head_on_a_Stick
Posts: 919
Joined: Sun Mar 17, 2019 3:37 pm

Re: Terminal Auto-Complete Function Not Working

#6 Post by Head_on_a_Stick »

Are we sure this is bash?

Code: Select all

echo $0
mod note: Signature removed, please read the forum rules

User avatar
stevedude
Posts: 68
Joined: Sat Aug 11, 2018 8:19 pm

Re: SOLVED - Terminal Auto-Complete Function Not Working

#7 Post 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.
OS:MX-19.2_x64|Kernel:4.15.0-1-amd64 x86_64|Xfce 4.14.2|Mobo:TUF X470-PLUS|CPU AMD Ryzen 5, 2600 MHz
Graphics:GeForce GTX 1060,driver:nvidia v:390.77|Audio:NVIDIA snd_hda_intel
Netwrk:Realtek RTL8111|Seagate:ST2000DM006, 1.82 TB|Mem:15.6 GB

Post Reply

Return to “Software / Configuration”