You are not logged in.

#1 2011-02-27 22:43:59

mitch_feaster
Member
From: San Diego, CA
Registered: 2011-02-27
Posts: 55
Website

[SOLVED] Bash built-in autocomplete with aliases

My built-in, vanilla bash completion isn't working... This isn't for custom completion functions (like those for git, pacman, etc) this is just completion of filenames/directories built in to bash (for aliases of commands like cd, ls, etc.)

For example, I have an alias set up for  `ls` like so:

alias ls='ls --color=auto -B'

but when I try to autocomplete through directories the vanilla bash autocompletion doesn't "work". I.e.:

ls /home<tab>

expands to `/home ` (note the space at the end), but

\ls /home<tab> #or if I just get rid of the alias altogether

expands to `/home/`, as expected (and desired, so I can keep drilling down further -- you know the drill smile ).

I've looked at the other auto-completion threads, but they all seem to want to make custom bash auto-completion work with alias for specific commands (like git, pacman, etc). I just need my plain ol' completion back! Any ideas?

Thanks!

Last edited by mitch_feaster (2011-02-28 03:05:25)

Offline

#2 2011-02-27 22:59:12

brenix
Member
From: California
Registered: 2008-03-05
Posts: 185

Re: [SOLVED] Bash built-in autocomplete with aliases

You might be having this issue... Check these two posts:

https://bugs.archlinux.org/task/22807
https://bbs.archlinux.org/viewtopic.php?id=113158

Offline

#3 2011-02-27 23:21:37

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] Bash built-in autocomplete with aliases

When you can't find an answer using the forum's search (happens to me often) try using Google to search.  You just have limit the search to the Archlinux forums with the phrase, "site:bbs.archlinux.org".

For example:

site:bbs.archlinux.org bash completion

To search the wiki is only a minor change:

site:wiki.archlinux.org bash completion

To search all of Archlinux:

site:archlinux.org bash completion

Offline

#4 2011-02-27 23:35:05

mitch_feaster
Member
From: San Diego, CA
Registered: 2011-02-27
Posts: 55
Website

Re: [SOLVED] Bash built-in autocomplete with aliases

Yep, that was the issue... Now I'm having another autocomplete issue (very similar so I don't think it warrants a new thread...): I have two directories in my home directory named `phpcode` and `private`, when I do

ls ph<tab>

or

ls phpc<tab>

it works as expected. But if I do

ls php<tab>

my input gets whacked down to just

ls p

and a double-tab offers the two `p` completions for phpcode and private. Same thing if I ever tab something with a leading *and* a trailing slash (i.e. /etc/<tab> or /home/mgalgs/Pictures/<tab>): these all get whacked down to just `/`   ....

I'm guessing it's probably some other rogue malfunctioning completion script... I've removed them all, removed bash-completion, re-installed, logged out/in, re-installed bash-completion and the problem persists... Does anyone else have this issue? If not, I guess I'll just move all 188 of them out of /etc/bash_completion.d/ and add them back one-by-one until I find the offending script... But that doesn't sound all that fun smile

@thisoldman: thanks for the tip smile

Offline

#5 2011-02-28 03:04:10

mitch_feaster
Member
From: San Diego, CA
Registered: 2011-02-27
Posts: 55
Website

Re: [SOLVED] Bash built-in autocomplete with aliases

Hmmm, never mind. It's working now! I'm really not sure what happened, I don't think I logged out/in or rebooted or changed anything... Oh well.

Offline

Board footer

Powered by FluxBB