3

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.

1
  • Have you edited your ~/.bashrc? You could try renaming it to .bashrc.backup and seeing if that fixes it.
    – Marius
    Mar 29, 2012 at 23:43

2 Answers 2

4

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

/etc/bash_completion.d/acroread.sh

Removing this file, worked correctly for me.

1
  • Yep! Already solved it, forgot to answer my own Q.. so you get the point. :) Apr 18, 2012 at 0:39
1

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.

7
  • 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) Mar 29, 2012 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! :( Mar 29, 2012 at 22:33
  • It's OK! Everyone does this sometimes. Mar 29, 2012 at 23:39
  • 1
    It's something wrong in my /etc/bash_completion file, but I don't know what. Mar 30, 2012 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. Mar 30, 2012 at 17:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .