# zig: Use env if using \`zls\` from shell env \(\#10559\) · gitcafe/zed

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

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

Visibility: public

Requested revision: da0d968a2cd558bf4957d837ed147b97bac06e1d

Requested commit: da0d968a2cd558bf4957d837ed147b97bac06e1d

Commit: da0d968a2cd558bf4957d837ed147b97bac06e1d

Tree: 9a387df1231c1171ec3d11c57b5253316ac35c53

Author: Thorsten Ball

Committer: GitHub

## Message

```
zig: Use env if using `zls` from shell env (#10559)

This fixes the problem of the Zig extension picking up `zls` from the
shell env but `zls` then failing to launch because it cannot find `zig`.

Scenario in which this happens:
- `.envrc` in a project that sets `$PATH` up
- in that `$PATH` there's `zls` and `zig`
- Zed is started from Dock
- Project is opened
- Shell env from project directory is loaded and used to get to `zls`
- `zls` is then started, without that environment set on the process
- `zls` cannot find `zig`

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
```

## Parents

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

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