# Accept shell environment after non-zero shell exit \(\#55175\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e5b98a5f199b65ac2aea8d01bcc8ba7369fef0ad

Requested commit: e5b98a5f199b65ac2aea8d01bcc8ba7369fef0ad

Commit: e5b98a5f199b65ac2aea8d01bcc8ba7369fef0ad

Tree: ceb5dc83dcd5653b065ed581fdf8090c3074b334

Author: Anthony Eid

Committer: GitHub

## Message

```
Accept shell environment after non-zero shell exit (#55175)

Summary:

When a user shell hook returned an error, Zed would fail to load the
shell environment even if the captured environment output was still
valid. This could prevent the terminal panel and other shell-dependent
features, such as the debugger and agent panel, from creating terminals
or running commands. That is especially disruptive when the shell
environment is valid and a terminal could otherwise still be used.

Zed now ignores the non-zero shell exit in this case when it can still
parse a valid shell environment, allowing those features to continue
working.

Self-Review Checklist:

- [x] I have reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed shell environment loading when login shells exit non-zero after
printing environment variables.
```

## Parents

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

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