Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14166

Re: why is dash confused with underscore in autocompletion?

From L A Walsh <bash@tlinx.org>
Newsgroups gnu.bash.bug
Subject Re: why is dash confused with underscore in autocompletion?
Date 2018-05-29 16:15 -0700
Message-ID <mailman.746.1527635740.1292.bug-bash@gnu.org> (permalink)
References <5B0DC703.9000203@tlinx.org> <74737bdd-031f-2b53-f5f4-1c98dfc581dc@redhat.com>

Show all headers | View raw



Eric Blake wrote:
> On 05/29/2018 04:32 PM, L A Walsh wrote:
>
>   
>> I'd expect it to autocomplete the entire filename for
>> 'remove-oldver-rpms-in-dir.pl' since it is the only file with a dash
>> after 'remove', but instead, bash prompts me again as though there
>> is some ambiguity between a dash and an underline.
>>     
>
> When you have case-insensitive completion, I _like_ having - and _ be 
> treated as case-insensitive counterparts (at least on US keyboards, 
> those two symbols are on the same key, and differ only on whether you 
> used shift, the same as other case-insensitive comparisons such as b/B).
>   
----
    If case completion should work the way you want, then 6 and '^',
for example, should also be treated as case-differing values.
'-' and '_' are not upper/lower case variations of the other even
with respect to hex placement, like lower case being 0x20 greater
than upper case.  While I certainly don't mind having an option
to include -_ as case-variations, I don't really like having it
as a standard or a default if I want it to ignore case with 'a'
vs. 'A'. 

    I often ignore case for filenames, as I often interact
with windows, but windows does not treat '-' and '_' as the
same character.  Having bash be the one exception that considers
them to be case-variations isn't logical nor helpful as having
a rule that ignores 'case'.  That doesn't preclude a separate
variable/switch for toggling the behavior.

    It's not like you can define a var in bash:

declare -l foo='AAA-BBB_ccc'

and have it change dashes into underscores (or vice-versa).
The fact that bash treats it differently in different places
is another problem.










Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: why is dash confused with underscore in autocompletion? L A Walsh <bash@tlinx.org> - 2018-05-29 16:15 -0700

csiph-web