Skip to content

Shell completion bash version check fail in git-bash on windows #2638

Closed
@koliyo

Description

@koliyo

I'm using windows with git-bash, and trying to set up bash shell completion following the readme.

I have added the following to my .bashrc

eval "$(_VREX_COMPLETE=bash_source vrex)"

But I get this error in new shell instances:

The file cannot be accessed by the system.

I have traced this to the subprocess execution of bash to check the version.

The problem is that the bash executable name is not working from my standard windows python installation.
Instead I need to explicitly add the full path to the git-bash executable, which is C:\Program Files\Git\bin\bash.exe

I have a working patch locally with using shutil.which('bash') to locate bash, which should work on all platforms. PR coming after this issue is submitted.

This is somewhat related to #2461, but that is a different issue, but both are specific to git-bash in windows.

Environment:

  • Python version: 3.12.0
  • Click version: 8.1.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions