You are not logged in.
Pages: 1
Suppose i have a directory named documents and a file named doctors. If I enter
$ cd doc<tab><tab>
documents/ doctors
If my memory is failing, I apologize, but in the past I thought the completion feature only would look for directories. Has something changed?
Offline
As long as I remember it it's done both files and folders. That's how it works on my system right now. It doesn't care what command it's started with (whether it be cd or cat, for example) so it shows all.
I imagine that you could get it to behave differently depending on command, but I've never looked into doing that.
Madly in love with Arch64, Openbox, DotA, and of course... penguins!
Happy to help if you're not a Help Vampire. Use your wonderful resources like ArchWiki, Google, and our wonderful search page.
Offline
Only completes folders here. Do you have bash-completion installed?
Offline
It depends on the command. With cd, completion should only match folders.
Offline
Actually yeah you guys are right, haha. I didn't test it well enough I guess. cd seems to only match folders, but all other commands seem to do both.
Madly in love with Arch64, Openbox, DotA, and of course... penguins!
Happy to help if you're not a Help Vampire. Use your wonderful resources like ArchWiki, Google, and our wonderful search page.
Offline
I'd like to suggest:
http://wiki.archlinux.org/index.php/Bas … Completion
I think you'll find what your looking for there, in order to setup bash completion that is smart enough to know to find directories only.
Offline
... or just use zsh.
Offline
or not
Offline
Yes, I do have bash-completion installed. And I read the wiki, but still don't understand. It was working right until recenty, don't know what happened. I'm tempted to try zsh, but I don't really want to change shells just because one command got a little funky. Any other ideas?
Offline
Reinstall bash and post (if they exist) your ~/.bashrc, ~/.bash_profile and ~/.profile
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
I reinstalled bash but the problem persists.
#.bashrc
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
alias dir='ls -d */'
alias move='mv -i'
PATH=$PATH:/home/d/bin
# bash_profile
$HOME/.bashrc
startx
Is there a configuration file for determining rules for completion? I can't imagine what I may have done to change this, other than updating my system. It seems odd that others aren't having this problem.
Offline
Is there a configuration file for determining rules for completion? I can't imagine what I may have done to change this, other than updating my system. It seems odd that others aren't having this problem.
Seems you still need this in your .bashrc, at least i do.
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
Offline
That worked! Thanks a lot droog, and everyone else.
Looking at my archived .bashrc from before the completion problem occurred, I see that the missing line of code wasn't there. Maybe bash_completion was previously started elsewhere on my system? So it's a mystery to me how this occurred, but all's well now.
Offline
First, sorry for bringing this old thread back...well,
As for the reason why bash_completion ain't sourced as described in the wiki, it is because your terminal is not a login shell. Check /etc/profile.d/bash_completion.sh and you will see.
Do as droog suggested. Works totally fine.
Last edited by lolilolicon (2009-08-30 04:50:23)
This silver ladybug at line 28...
Offline
Yeah, I had posted a bug report about this back in the days when we had a bug tracker. /etc/profile.d/bash_completion is deciding whether to automatically call /etc/bash_completion for you. They used to decide based on the non-emptiness of "$PS1", which would include all interactive shells; now they decide based on "shopt -q login_shell" which only includes login shells. I don't think this change is justified, but...
Offline
Pages: 1