Reputation: 551
gnu/make supports non-latin identifiers (f.e., targets) in makefile.
example:
$ cat GNUmakefile
test:
@echo test
тест:
@echo test in russian
$ make test тест
test
test in russian
but the bash-completion with this example completes only one target — test
:
"make " + tab → "make test".
how to add non-latin targets to completion list?
tested on various list of distributions (debian 5-8, ubuntu 12-15, centos 5-6, mandriva 2008) with different versions of bash-completion.
i need support for this feature at least with recent version of the bash-completion.
Upvotes: 4
Views: 124
Reputation: 551
i found the solution.
bug in the function _make_target_extract_script
from the file /usr/share/bash-completion/completions/make
, which returns sed-script, which contains line:
/^[^a-zA-Z0-9]/ d # convention for hidden tgt
which removes the targets that begins (in particular) with a non-latin character.
such a regexp would be more appropriate, in my opinion (see this):
/^[^[[:alnum:]]]/ d # convention for hidden tgt
if you can not edit the /usr/share/bash-completion/completions/make
, you can add to ~/.bashrc
such lines (based on this answer):
_completion_loader make
eval "$(type _make_target_extract_script | sed '1d;s/a-zA-Z0-9/[[:alnum:]]/')"
update
i submit a bug report (unfortunately, registration required).
Upvotes: 4
Reputation: 803
The direct solution would be to switch to zsh
with oh-my-zsh
if you want to see this working.
Bash
is known for various bugs and unsupported features. zsh
works 2 times faster and almost fully compatible with bash
POSIX shell, so most of your bashrc
and shell
scripts will work the same way with either bash
and zsh
.
Upvotes: 1