在OSX上,我当前的语言环境设置为英语UTF-8,但似乎并不是一致的。当我创建两个文件时,其中一个文件具有常规a
,另一个文件具有重音á
,自动完成功能将停止正常工作。这就是我所看到的:
/tmp/locale $ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
/tmp $ mkdir locale && cd locale
/tmp/locale $ touch foobar
/tmp/locale $ touch foobár
# when I type "foo" and hit TAB, bash will autocomplete with "ba"
# if I keep pressing TAB, both files will be displayed:
/tmp/locale $ ls foo<TAB>
/tmp/locale $ ls fooba<TAB>
foobar foobár
# however, at this point, I can only finish writing "foobar"
# no combination of characters will allow me to autocomplete "foobár"
# if I type "foobá" and hit TAB, no files are displayed:
/tmp/locale $ ls foobá<TAB>
/tmp/locale $ ls foobár<TAB>
# <no files displayed for either>
# Using wildcard won't work either:
/tmp/locale $ ls foobá*
ls: cannot access foobá*: No such file or directory
# but this works correctly (wtf?):
/tmp/locale $ ls foobár
foobár
在Linux机器上,这一切都不会发生,事情就像任何人预期的那样有效。是什么给了什么?