# Add a setting for Threads Sidebar auto-open \(\#64259\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 52e0b848dafed5d59a7634995b8b7021672dc5ab

Requested commit: 52e0b848dafed5d59a7634995b8b7021672dc5ab

Commit: 52e0b848dafed5d59a7634995b8b7021672dc5ab

Tree: adff952044149683b7bd0460b78b421a37475a1f

Author: Jack Walters

Committer: GitHub

## Message

```
Add a setting for Threads Sidebar auto-open (#64259)

Closes https://github.com/zed-industries/zed/discussions/64266

Opening a folder in an existing window force-opens the Threads Sidebar,
and there is no way to prevent it. `open_paths` called
`MultiWorkspace::open_sidebar` unconditionally on the reused window, so
the sidebar reopened on every such open regardless of whether the user
had closed it.

This adds `agent.threads_sidebar_auto_open`, defaulting to `true` so
current behavior is unchanged. With `false`, the folder still opens in
the existing window, but the sidebar stays closed.

This path is reached when `default_open_behavior` or
`cli_default_open_behavior` is set to `existing_window`.

`open_sidebar` was doing double duty: besides showing the sidebar, it
pinned the workspace being navigated away from so it survives the
switch. When the setting is disabled, `retain_active_workspace` is
called instead, so only sidebar visibility changes.


https://github.com/user-attachments/assets/fc299df0-27e2-4ac6-98cb-d817d5f71d0e

## Tests

Two tests in `multi_workspace_tests.rs` cover both branches: the sidebar
opens by default, and stays closed when the setting is disabled while
the folder still opens in the same window.

Release Notes:

- Added `agent.threads_sidebar_auto_open` to control whether opening a
folder in an existing window also opens the Threads Sidebar
```

## Parents

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

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