# cli: Use \-\-wait to prefer focused window \(\#41051\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 821a4880bd2c601a494db0e564ce941158638e8c

Requested commit: 821a4880bd2c601a494db0e564ce941158638e8c

Commit: 821a4880bd2c601a494db0e564ce941158638e8c

Tree: f2921a85bb106465c533d2efa433c810829ac6ba

Author: Dino

Committer: GitHub

## Message

```
cli: Use --wait to prefer focused window (#41051)

Introduce a new `prefer_focused_window` field to the
`workspace::OpenOptions` struct that, when provided, will make it so
that Zed opens the provided path in the currently focused window.

This will now automatically be set to true when the `--wait` flag is
used with the CLI.

Closes #40551 

Release Notes:

- Improved the `--wait` flag in Zed's CLI so as to always open the
provided file in the currently focused window

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

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

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