# Improve bash detection on Windows \(\#43455\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/3072133e5965e16f956509a600faaef482a10195)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 3072133e5965e16f956509a600faaef482a10195

Requested commit: 3072133e5965e16f956509a600faaef482a10195

Commit: 3072133e5965e16f956509a600faaef482a10195

Tree: dc2b3b0bccb0f6b2aca5ee26c90eddfdcda3eb69

Author: qystishere

Committer: GitHub

## Message

````
Improve bash detection on Windows (#43455)

I have git installed via [scoop](https://scoop.sh). The current
implementation finds `git.exe` in scoop's shims folder and then tries to
find `bash.exe` relative to it.

For example, `git.exe` (shim) is located at:
```
C:\Users\<username>\scoop\shims\git.exe
```

And the code tries to find `bash.exe` at:
```
C:\Users\<username>\scoop\shims\..\bin\bash.exe
```
which doesn't exist.

This PR changes the logic to first check if `bash.exe` is available in
PATH (using `which::which`), and only falls back to the git-relative
path if that fails.
````

## Parents

- [56a2f9cfcf0c6a3c38f596b58002953763cd890f](https://git.cafe/gitcafe/zed/commit/56a2f9cfcf0c6a3c38f596b58002953763cd890f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/3072133e5965e16f956509a600faaef482a10195?format=markdown)
