Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

There's something odd about my autocomplete in the gnome terminal.

I used to be able to type cp Downtab to get cp Downloads/, and then type Jettab to end up with cp Downloads/Jet\ Pack\ Instructions.pdf

But now, when I have cp Down typed and hit tab, I get cp Downloads with a space afterwards. And if I backspace that and make it say cp Downloads/Jet and hit tab, I get cp Downloads/Jet Pack Instructions.pdf without the backslashes.

It wasn't like this before. How do I fix this?

EDIT: There's a problem with my /etc/bash_completion file, it seems. Just not sure what.

share|improve this question
    
Have you edited your ~/.bashrc? You could try renaming it to .bashrc.backup and seeing if that fixes it. –  Marius Mar 29 '12 at 23:43
add comment

2 Answers

up vote 4 down vote accepted

It is caused due to acrobat reader. The file is -

/etc/bash_completion.d/acroread.sh

Removing this file, worked correctly for me.

share|improve this answer
    
Yep! Already solved it, forgot to answer my own Q.. so you get the point. :) –  CaptSaltyJack Apr 18 '12 at 0:39
add comment

Edit:

Sorry, my original suggestion was incorrect; I didn't pay attention and was thinking about autocompletion when you press the up-arrow, not tab (as pointed out to me after my post).

Original suggestion about history autocompletion

This is controlled by the file ~/.bash_history, which is a text file, so you can look at it, or even edit it. It doesn't save your history forever, so it's possible the old one scrolled off the list. It's also possible that this file got corrupted somehow.

It should be just a long list of commands, in reverse chronological order, with each command on a single line, delimited by linebreaks, so you should be able to see if there's something unusual in it.

I never really thought about this, but you could probably save lines you use a lot, and occasionally append it to this file to make sure you always have those commands.

A better suggestion for Tab Autocompletion

Did you edit this? I don't think it changes, so maybe it's something that was added to /etc/bash_completion.d, which seems to have scripts added to it by installed apps. You could try disabling some of the ones with more recent timestamps to see if it makes a difference, then adding them back one by one or in small groups until it changes. I don't know much about this, but I'm usually good at fixing problems, so my suggestions are not from prior knowledge, but just me trying to be helpful.

share|improve this answer
1  
It's not controlled by history - tabcompletion has to do with directories and paths, and doesn't check the past entries at all. You are thinking of command history (pressing up) not completion (pressing tab) –  Andrew Mar 29 '12 at 22:05
1  
Oh, you're right, I wasn't thinking clearly. I'll edit my post to avoid confusing anyone else besides myself! :( –  Marty Fried Mar 29 '12 at 22:33
    
It's OK! Everyone does this sometimes. –  Andrew Mar 29 '12 at 23:39
1  
It's something wrong in my /etc/bash_completion file, but I don't know what. –  CaptSaltyJack Mar 30 '12 at 16:17
2  
Did you edit this? I don't think it changes, so maybe it's something that was added to /etc/bash_completion.d, which seems to have scripts added to it by installed apps. You could try disabling some of the ones with more recent timestamps to see if it makes a difference, then adding them back one by one or in small groups until it changes. I don't know much about this, but I'm usually good at fixing problems, so my suggestions are not from prior knowledge, but just me trying to be helpful. –  Marty Fried Mar 30 '12 at 17:49
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.