[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: req for fix: Completion: inconsistent case correction and '/' append
Re: req for fix: Completion: inconsistent case correction and '/' appending(for dirs)
Fri, 08 Jun 2012 11:41:58 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120601 Thunderbird/13.0
On 5/31/12 3:56 PM, Linda Walsh wrote:
> if I type in a path:
> (1st example)
>> ls -d /share/doc/new<tab>, bash displays:
> ls /share/doc/New\ Folder
> Pressing 'Enter' gets:
> ls: cannot access /share/doc/New Folder: No such file or directory
> (2nd example)
>> ls /share/do<tab>
> ls /share/Doc/n<tab>
> ls /share/Doc/New\ Folder/ (<enter>)
> /share/Doc/New Folder//
Let me fill in some of the missing pieces so this makes sense to everyone.
I'll make some assumptions because you don't say anything about the version
of bash you're using.
You have enabled the `dirspell' shell option, which causes the directory
rewrite part of completion to perform spelling correction like the cd
You don't have the `direxpand' shell option enabled, which would have
replaced the directory name with the corrected version.
You have readline's completion-ignore-case option enabled, which causes
readline's builtin filename completion to perform case-insensitive
comparisons and change case according to what it reads from the file
The dirspell and direxpand options should really be set together, for just
the reason you uncovered. It's probably worth it for bash to inhibit
spelling correction unless direxpand is set.
The slash gets appended because you set the `mark-directories' readline
variable, and readline was able to detect that the pathname was a
directory. `ls -d' appends a slash unconditionally.
Setting `direxpand' will make things behave as you'd like.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/
- Re: req for fix: Completion: inconsistent case correction and '/' appending(for dirs),
Chet Ramey <=