These are the files and snippets of files that I have found to be of interest for this problem. Note that I am running Ubuntu 10.04
You might be able to figure out what the problem is from my configuration files. Otherwise, maybe consider posting your corresponding configuration.
last part of ~/.bashrc
# 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
40% down the page in /etc/bash.bashrc
(Do you have this portion commented out too?)
# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
# . /etc/bash_completion
#fi
I found these articles to be of interest:
http://www.linux.com/archive/feed/54005
http://www.debian-administration.org/articles/316
I'll have to do some more research... but this is what I got so far.
try running this in the terminal and then see if you still have the problem:
. /etc/bash_completion
Edit: found that tab-completion is handled by /etc/bash_completion. Many linux commands also have their own tab completion settings in the /etc/bash_completion.d/ directory.
Other people have also had this problem:
http://forums.gentoo.org/viewtopic-t-751913-start-0.html
https://bugzilla.redhat.com/show_bug.cgi?id=583919
This could be a bug in your version of bash. So now the real question is... What version of bash do you have?
Just so the solution is easy to find for others that have this issue:
"It may be an issue with the /etc/bash_completion script. Try reinstalling the bash_completion package. Does it still have the problem? – W_Whalley"
-see comments
2I'm having this problem on Mac OS with GNU bash 3.2.57. It only happens sometimes. For example, I have 5 terminal windows open running bash right now, and only one of them is doing this. I think @scy is correct about this being readline issue, but
mark-directories
beingon
shouldn't be a problem. I'm guessing that I have hit a strayCTRL-something
at some point and broken this particular terminal. – Christopher Schultz – 2016-02-11T15:14:54.787Does it do this regardless of the command at the beginning of the line or only for some particular ones? For example:
cat filen[TAB]
vs.somecommand filen[TAB]
– Paused until further notice. – 2010-05-24T16:37:15.717@Dennis Williamson - seems to be all commands. Will update the question. – AJ. – 2010-05-24T16:50:42.333
Do these files have executable permission set? – Doug Harris – 2010-05-24T17:15:47.903
@Doug Harris - no – AJ. – 2010-05-24T17:21:58.560
Is this happening just for python files? – Doug Harris – 2010-05-24T18:16:36.523
@Doug Harris - no it happens for any type of file... – AJ. – 2010-05-24T19:47:14.267
What does "complete -p|grep ' cat$'" print? – Florian Diesch – 2010-05-26T14:22:38.847
@Florian Diesch - nothing. – AJ. – 2010-05-26T17:25:17.067
Any chance these files are symlinks to directories? What does
echo $INPUTRC
print? If it's a filename, what are the contents of that file? IfINPUTRC
is null or not set, what does~/.inputrc
contain? – Spiff – 2010-05-28T22:07:18.4733It may be an issue with the /etc/bash_completion script. Try reinstalling the bash_completion package. Does it still have the problem? – W_Whalley – 2010-05-31T17:12:41.800
In addition what W_Whalley suggested, you could also test the non-system-wide route: either create a new user and/or a user without any files in his home dir, so we can exclude any possibly user-specific miss-configuration. Btw, my Lenny with all updates and
/etc/bash_completion
has an md5 of82204653036cee93705cbf9fd9f0654d
. – mark – 2010-06-01T11:54:46.8401@W_Whalley - that was it. Please post this as an answer so I can reward you the bounty. Thanks! – AJ. – 2010-06-01T14:57:47.790
1@W_Whalley - FYI the bounty ends in 1 day. Please post your answer below so that I may give you credit. Thanks again for your help! – AJ. – 2010-06-02T18:05:28.450