-
-
Notifications
You must be signed in to change notification settings - Fork 118
Description
Hello,
I and a few colleagues are currently working on adding Unicode (i.e., non-ASCII) natural language file/directory completion support for Bash and other shells.
Our method involves "hacking" (redefining and overriding) functions such as _comp_compgen_filedir or _comp_compgen__call_builtin. You can view a few existing solutions here:
- https://github.com/calsys456/bash-pinyin-completion-cpp/blob/main/scripts/bash_pinyin_completion
- https://github.com/muxueqz/bash-completion-pinyin.nim/blob/master/pinyin.completion
- https://github.com/AOSC-Dev/bash-pinyin-completion-rs/blob/main/scripts/bash_pinyin_completion
This approach currently works in environments using only bash-completion (without ble.sh), functioning correctly for both external commands and built-in commands being completed.
However, when using ble.sh, only external commands like ls and rmdir are completed correctly (while basic auto-completion functions as expected, see attached image). Built-in commands such as cd and pushd (which are highlighted as red by default in ble.sh), do not utilise our custom completion method. I also noted that other built-in commands (highlighted as purple by default in ble.sh) do not have this issue and work correctly with our custom completion.
above: only read named cd not works here
I am unsure what is special about the completion mechanism for built-in commands highlighted in red in ble.sh. Does it employ an implementation method different from standard bash-completion? I attempted to locate the relevant points by searching the source code but, unfortunately, was unsuccessful. I would greatly appreciate any explanation or assistance you can offer.
Thank you.
P.S. I know your native language is Japanese. I have heard that some people in Japan also desire similar completion functionality. I am personally re-implementing another Unicode completion scheme (see https://github.com/CicadaSeventeen/polLingua_Completion), which, unlike other implementations, focuses more on the possibility of supporting multiple natural languages instead of a single language. Although Japanese support is temporarily unavailable due to some difficulties, it should be supported in the future. However, this is another off-topic discussion.