Re: Bash autocompletion
On Thu, 17 Apr 2003 10:59:44 +0200
Michael Naumann <michael.n@strux.net> wrote:
> I find the TAB-completion feature of bash very handy and use
> it everytime. Yet I have two issues with this feature.
>
> a) I start a commandline like
> scp gemini:/tm
> here I press tab (gemini is a valid hostname in my network).
> The line becomes:
> scp gemini:gemini\:/tmp
> and is thus pretty useless.
> What can I do to prevent this?
Nothing. You're asking the system to do the impossible, and bash is good but
not telepathic. When you type the scp command you're not on the remote
system yet, so there's no way bash to know what the remote root filesystem
looks like.
> b) If a file does not have the proposed extension the completion
> will not work. Example:
> I have a file called "Song of joy.mp2"
> Now I start the commandline
> xmms Song
> Here I press tab, but due to the .mp2 (instead of .mp3) part
> of the filename nothing gets expanded.
> Can this clever autoindent feature be disabled temporarily?
You've told xmms where your music is stashed, but bash has no way to know
that. If you did "xmms /path/to/mp2s/Song<tab>" the path completion should
work.
It may be possible to tweak /etc/bash_completion to make this work, but I'm
not familiar with it.
Kevin
Reply to: