[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hyphens (-) and underscores (_) are not treated as equivalent with c

From: awa54
Subject: Re: hyphens (-) and underscores (_) are not treated as equivalent with completion-map-case and completion-ignore-case enabled
Date: Wed, 20 Jan 2021 09:07:46 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.1

On 2021-01-19 22:32, Chet Ramey wrote:
On 1/19/21 8:30 AM, awa54@cdak.net wrote:

Bash Version: 5.1
Patch Level: 4
Release Status: release


man bash says:
 > completion-map-case (Off)
 > If set to On, and completion-ignore-case is enabled, readline treats hyphens (-) and underscores (_) as equivalent when performing case-insensitive filename matching and completion.

$ bind -v|grep case
set completion-ignore-case on
set completion-map-case on


So it should be enabled and when I type

$ touch _test
$ chmod +x -t<TAB>

it completes to

$ chmod +x _test

But neither

$ ./-t<TAB>
$ ls -t<TAB>


If I turn off progcomp with `shopt -u progcomp` (as suggested here https://unix.stackexchange.com/questions/629844/bash-completion) it allows the `ls` example to complete but not the other.

Thanks for the report. Those two options work for filename completion, but
not command completion (the bulk of which is handled outside readline).
I'll take a look at exposing that functionality outside readline, since
it's currently part of readline's filename completion, but that will take
some time and probably require a version bump.

That's great, thank you for your efforts!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]