Replies: 6 comments 12 replies
-
This thread is for bash. |
Beta Was this translation helpful? Give feedback.
-
This thread is for fish |
Beta Was this translation helpful? Give feedback.
-
This thread is for zsh. |
Beta Was this translation helpful? Give feedback.
-
This thread is for elvish |
Beta Was this translation helpful? Give feedback.
-
This thread is for powershell. |
Beta Was this translation helpful? Give feedback.
-
Meta thread |
Beta Was this translation helpful? Give feedback.
-
The current approach for dynamic completion is to write a glue script for each shell to call the
COMPLETER
implemented in Rust. The issue is that the built-in commands and variables differ between shells, making it difficult to pass consistent parameters to theCOMPLETER
via the glue script. For example, in bash, theCOMP_WORDS
variable is an array split by the characters in theCOMP_WORDBREAKS
variable, so--flag=value
would be split into[--flag, =, value]
. However, in Fish, they are not split. In summary, the behavior of each shell varies, and we aim to pass consistent parameters to theCOMPLETER
. If necessary, we might even need to obtain the entire command line and quote it.There are already some command line argument parser projects:
argc-completionsstatic completionsHow do they implement dynamic completion for various shells?
Related issues:
#1232
#3166
Beta Was this translation helpful? Give feedback.
All reactions