[Top][All Lists]

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

Re: why is dash confused with underscore in autocompletion?

From: L A Walsh
Subject: Re: why is dash confused with underscore in autocompletion?
Date: Tue, 29 May 2018 16:15:28 -0700
User-agent: Thunderbird

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.

reply via email to

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