[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `set completion-ignore-case on' does not work well for the first wor
From: |
Jian Wang |
Subject: |
Re: `set completion-ignore-case on' does not work well for the first word on command line |
Date: |
Sun, 17 Feb 2008 08:56:20 +0800 |
On Feb 17, 2008 5:21 AM, Chet Ramey <chet.ramey@case.edu> wrote:
> Jian Wang wrote:
> > When using Bash, I often turn on the `completion-ignore-case' option of
> > readline. It works fine for most cases but sometimes it does not work as
> > expected when completing the first word on the command line. For
> example,
> > there is a bash script ~/MyDir/Foo.sh, on command line, when I input
> ~/my
> > and then press TAB, the word is completed as ~/myDir . Is that a bug?
>
> It's not really a bug, since case-ignoring does not necessarily mean
> case-changing (this is usually called `case-preserving'). Readline uses
> what's found in the file system rather than preserving what the user
> typed, though, as you noticed when you tried to do word completion instead
> of command completion. It might be useful to emulate Readline's behavior
> while doing command word completion.
>
Thanks for your reply but I'm a bit confused. You said that readline uses
what's found in the file system rather than preserving what the user typed.
But for my example, ~/MyDir should be found in the file system but why it's
completed as ~/myDir? Readline behaves differently between word completion
and command completion? Or, command completion is done by Bash itself other
than readline? And I noticed that if I first input /home/myname/my and than
press TAB, it'll be correctly completed as /home/myname/MyDir . What's the
difference?
>
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> Live Strong. No day but today.
> Chet Ramey, ITS, CWRU chet@case.edu
> http://cnswww.cns.cwru.edu/~chet/ <http://cnswww.cns.cwru.edu/%7Echet/>
>
>