Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

[bash completion] _az_python_argcomplete generates empty output in Git Bash #26051

Open mloskot opened 1 year ago

mloskot commented 1 year ago
  1. Paste this function to Git Bash

    https://github.com/Azure/azure-cli/blob/f6ea6fcc834d5e448a1e5df9257f2d47e2a05b78/az.completion#L1-L20

  2. Run _az_python_argcomplete "az"

  3. Observe empty output

In other words, for some reasons, sourcing https://github.com/Azure/azure-cli/blob/f6ea6fcc834d5e448a1e5df9257f2d47e2a05b78/az.completion into Git Bash does not configure completion for az.

$ az version
Azure-cli    Azure-cli-core    Azure-cli-telemetry
-----------  ----------------  ---------------------
2.46.0       2.46.0            1.0.8
yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

yonzhan commented 1 year ago

@bebound for awareness

bebound commented 1 year ago

This file is for Bash, not Git Bash. File descriptor on windows is different from Linux. https://github.com/kislyuk/argcomplete/tree/develop/contrib#git-bash-support

mloskot commented 1 year ago

I see. It would be helpful if there is a test for MSYS env included.