# cli: Make \`zed \-\-wait \-\-diff\` not wait until window close \(\#54367\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e4d0c89c9f838062e214cc208ca8e63371231d44

Requested commit: e4d0c89c9f838062e214cc208ca8e63371231d44

Commit: e4d0c89c9f838062e214cc208ca8e63371231d44

Tree: f79b2aa4ba8bc9698303446c8f9af670544888a0

Author: Tim Vermeulen

Committer: GitHub

## Message

```
cli: Make `zed --wait --diff` not wait until window close (#54367)

`zed --wait --diff <left> <right>` currently waits for the entire window
to close instead of just the diff itself, due to the combination of
- `zed --diff` adds the cwd to the paths to open (see #45131), and
- passing a directory to `zed --wait` blocks until the Zed window is
closed (see #44936), which doesn't distinguish between explicit paths
and the one `zed --diff` adds

Fixed by only running the `zed --wait <dir>` logic to block until the
window is closed in case the user actually passed any non-diff paths.

I've confirmed locally that it works, though I wasn't really sure how to
write a good test for this.

Self-Review Checklist:

- [x] I've 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- `zed --wait --diff <left> <right>` now blocks until the diff is
closed, and not until the entire window is closed.
```

## Parents

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

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