# cli: Always open new window when \`cli_default_open_behavior=new_window\` \(\#59415\) · gitcafe/zed

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

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

Visibility: public

Requested revision: df33d7866100abb8b8a21bd61507402eb4c81b90

Requested commit: df33d7866100abb8b8a21bd61507402eb4c81b90

Commit: df33d7866100abb8b8a21bd61507402eb4c81b90

Tree: 0a84206b1f60ecb7cba53ba49d7b8c44eb77ce34

Author: Bennet Bo Fenner

Committer: GitHub

## Message

````
cli: Always open new window when `cli_default_open_behavior=new_window` (#59415)

This makes sure that the behaviour of the CLI matches that of the UI.
In Zed itself we always open a new window (e.g. when clicking on Open
Project in new window in the recent projects picker), but in the CLI we
where re-using existing windows even when specifying
"cli_default_open_behavior": "new_window".
This caused confusion, so this PR ensures that we always open a new
window, even if that folder is already open. We still focus the active
window in the case where the path is a subpath of a project that is
already open.

Can be tested with

```
cd crates/cli
cargo run -- --zed ../../target/debug/zed somefolder
```

Release Notes:

- cli: Ensure `zed somefolder` always opens a new window, even when
`cli_default_open_behavior` is set to `new_window` and the project is
already open
````

## Parents

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

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