Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a problem with bash completion after a system upgrade.

$ mkdir abcde    
$ cd abc[TAB] 

does nothing, while in the older bash versions it would expand to $ cd abcde.

Some older forum on bash suggests setting the direxpand option, but seemingly it is missing in the bash 4.2:

$ shopt -s direxpand  
bash: shopt: direxpand: invalid shell option name  

(I have upgraded from Fedora 11 to Fedora 17 with its bash-4.2.37)

Is there a way around it?

share|improve this question
1  
You're mixing up expansion and completion, which are two different things. Your version of Bash indeed doesn't have the direxpand option yet, but all direxpand would do is expand a directory from a variable, e.g. dir=/usr/local, and then you could expand $dir/somewhere/else to /usr/local/somewhere/else by pressing Tab. Bash should always complete directory names. Are you sure there aren't any other files/directories in your current directory starting with abc? Have you tried pressing Tab twice? –  slhck Jan 18 '13 at 8:35

1 Answer 1

bash uses the readline library for input, tab should map to the readline complete operation (this is distinct from the bash command of the same name, though related in operation).

There are a number of possible causes, things to check are:

  • test to see if any of the other completions work: meta-? (probably alt+shift+?`) this should list all matches (similar to pressing tab twice)
  • check to see if ctrl-i works instead (alternate way of entering tab)
  • check your TERM variable, and the output of stty (should not contain any reference to tab)
  • check what bash completion features may be defined, run complete with no arguments to list them
  • your readline may be messed up, check /etc/inputrc and your ~/.inputrc (if any), and the output of bind -q complete. It should contain at least "\C-i" meaning ctrl-i (tab)
  • check to see if anything has broken readline key sequence for tab: bind -S (should not contain "\C-i")
  • If you run bind '"\C-i": complete' does it start working as expected?
share|improve this answer

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.