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
This commit is contained in:
Jack Walters authored and GitHub committed 2026-09-16 16:03:50 +00:00
1 parent 2433f1d15d
commit d9abcde22a
9 files changed
+161 -2

No files matched your search

+22
View File
@@ -145,6 +145,28 @@ If you haven’t manually resized the sidebar, its width follows changes to this
Widths saved by older versions of Zed are preserved if they differ from the previous default of 300 pixels. A saved width of 300 pixels uses this setting instead.
### Threads Sidebar Auto Open {#agent-threads-sidebar-auto-open}
- Description: Whether opening a folder in an existing window automatically opens the [Threads Sidebar](../ai/parallel-agents.md#threads-sidebar).
- Setting: `agent.threads_sidebar_auto_open`
- Default: `true`
**Options**
`true` or `false`.
This applies when a folder opens in an existing window instead of a new one, which happens when `default_open_behavior` or `cli_default_open_behavior` is set to `existing_window`. With `false`, the folder still opens in that window, but the sidebar stays closed until you open it with {#action multi_workspace::ToggleWorkspaceSidebar}.
Open the Settings Editor and search for “Threads Sidebar Auto Open”. Or add this to your `settings.json`:
```json [settings]
{
"agent": {
"threads_sidebar_auto_open": false
}
}
```
## Agent UI Font Size
- Description: The font size for text in the agent panel. Inherits the UI font size if unset.