Commit Graph

937 Commits

Author SHA1 Message Date
Finn Evers 3e23a0c482 Change the default settings value for file_finder.prefill_query_from_selection (#66856)
Closes https://github.com/zed-industries/zed/issues/66651

Changes the default for `prefill_query_from_selection`, as this is a
rather intrusive setting/breaking change and should not have went in
like it did here for all finders.

## Testing

Updated the existing tests.

## Self-review

- [X] I've reviewed my diff for quality, security, reliability, and
performance.
- [N/A] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [X] Tests cover the new or changed behavior.

Release Notes:

- Breaking: Changed the default value for the
`file_finder.prefill_query_from_selection` from `true` to `false`. If
you want to return to the previous behavior, toggle the setting at
[zed://settings/file_finder.prefill_query_from_selection](zed://settings/file_finder.prefill_query_from_selection)
2026-11-12 00:08:05 +00:00
overcome ba06cc5191 Add setting to show/hide title bar (#65671)
## Summary

Restores `title_bar.show` from #37428 with `always`, `never`, and
`hide_in_full_screen`.

- On macOS the whole native titlebar is hidden, so fullscreen no longer
reveals an empty bar at the top edge.
- The Threads Sidebar and thread history headers drop their window
controls together with the title bar.
- With client-side decorations, the window frame is square at corners
where no title bar, status bar or sidebar rounds the content.
- Leaving the Threads Sidebar falls back to the workspace when the
previously focused element is gone.

Includes macOS window-control handling adapted from #42540.

Related discussion: #55183.

## Testing

Tests and clippy for the touched crates pass on macOS and Linux.
Not run on Windows or under a real Linux compositor.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover visibility changes and focus restoration.

Release Notes:

- Added a setting to hide the title bar always or only in fullscreen.
- [GPUI] Added `Window::set_native_titlebar_visibility` on macOS and
`FocusHandle::is_rendered`.
- [GPUI] Fixed fullscreen changes not notifying window bounds observers
on Wayland and X11.
- [GPUI] Fixed the macOS titlebar staying opaque after a failed
fullscreen entry.

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-11-11 19:41:02 +00:00
Michal Matczuk 051a638727 git_ui: Add commit view defaults for descriptions and files (#66331)
The commit view always opens with the description folded and all files
expanded.

This PR adds two settings so you can choose how it opens:

```json
"git": {
  "commit_view": {
    "expand_description": false,
    "expand_files": true
  }
}
```

Set `expand_description` to `true` to show the full commit message, or
`expand_files` to `false` to start with all changed files collapsed.
The defaults preserve the current behavior.
They are also available in Settings → Version Control → Git Commit View.
That section also absorbs the existing "Show Full File by Default"
setting from the former "File Diff" section, so everything for views
opened from a commit lives together. The JSON keys are unchanged.

The settings follow the existing `git.file_diff` pattern, and file
collapsing reuses the logic for folding binary files after the diff
loads.

Related: https://github.com/zed-industries/zed/discussions/64543

<!-- Add a screenshot of the "Git Commit View" section in Settings →
Version Control. -->

## Testing

Manually tested on Linux (Fedora 44, Wayland) with a debug build.



https://github.com/user-attachments/assets/d3db1251-de37-4978-9770-825dda15c0b0


## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Added `git.commit_view.expand_description` and
`git.commit_view.expand_files` to control whether the commit view opens
with the full commit message shown and the changed files expanded.
2026-11-09 11:03:27 +00:00
Frederick Morlock 9a8ab54db4 agent: Allow auto title generation to be disabled (#63998)
# Objective

The objective of this PR is to add a configuration option to disable
automatic title generation for agent threads. This feature is desirable
for users (e.g. as discussed in #63701) with token-based or compute
constraints as it can prevent unnecessary (for some) overhead from title
generation in addition to unnecessary large cache misses.

My personal motivation is that automatic title generation pushes my
entire context to my compute backend, which is a complete cache miss
because (it appears) the prefix to the prompt is different. Whether it
is intentional or not, automatic title generation can fire concurrent to
actual generation (see Misc Notes [1]), slowing down my machine (and the
output) considerably.

## Solution

This PR adds a configuration option, which is exposed in the UI as well
as through the standard settings.json channels, to disable automatic
title generation. It's worth noting that manual title generation, as
well as manual thread renaming, is still preserved. The configuration
merely disables the _automatic_ title generation when the option is
enabled.

Ignoring the code for setting up the configuration option, this PR
effectively adds a single condition to the `generate_title` call in
`thread.rs` (in `run_turn_internal` that constitutes the automatic title
generation. To my knowledge, this is what constitutes the "automatic
title generation" and in the situation where I've seen it triggered
reliably, it is no longer triggered when the disabling option is set.

## Testing

- Did you test these changes? If so, how?
- _Yes. I tested the functionality manually through disabling the
"Auto-Generate Thread Titles" option in the Settings UI and triggering
the condition where I knew automatic title generation would fire
(described in Misc Notes [1]). I also tested manual title renaming and
the "Regenerate thread title" function to ensure those functions were
not affected. I also ran `cargo test --workspace`, which succeeded, and
did UI regression tests (although it appears that my settings menu
changes were not covered by them, since they did not fail when I didn't
update the baseline)_
- _I also added automated tests for the feature, as well as tests to
ensure that manual title generation is not affected._
- Are there any parts that need more testing?
- _I was unable to fully test "Regenerate thread title" because it seems
incompatible with my local LLM (it gets updated to a blank string after
the compute backend returns). This is the case with the latest stable
Zed (v1.19.2) and does not constitute a regression in my eyes. The
automated tests I wrote should cover any regressions for users with a
fully functional "Regenerate thread title" button._
- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
- _Try to trigger automatic title generation with "Auto-Generate Thread
Titles" enabled and disabled. You can verify that manual title
generation ("Regenerate Thread Title") and manual title renaming also
works._
- _It's worth noting that hosting my own compute backend (oMLX) was
crucial in discovering and diagnosing this problem. If a tester does not
have access to this, they will need to find another method of knowing if
the `generate_title` method fires (such as a simple `println!`)._
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
- _**I only tested my changes on macOS 27 beta**, although the change
set should be platform agnostic._

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [X] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

## Showcase

I have provided a screenshot of the location of the new toggle below

<details>
  <summary>Click to view screenshot of Settings page</summary>
<img width="1012" height="863" alt="Screenshot 2026-09-09 at 9 41 27 PM"
src="https://github.com/user-attachments/assets/5dd14f38-8cd1-46d1-b5bf-f2a6fb68c628"
/>

Above is a screenshot of the placement of the new Settings Menu item
("Auto-Generate Thread Titles"). It is disabled, which is not the
default.

</details>

## Misc Notes

[1]: My "sure fire" way of triggering the automatic title generation (at
an inconvenient time) is to stop a prefill request after sending a
message in an existing thread (which will trigger the automatic title
generation) then resend the message. Perhaps a healthier behaviour would
be to cancel in-progress title generation if another generation request
come in, but I think it is advantageous to give users an option to
disable automatic title generation regardless.

**LLM-Use Disclosure:** I used an LLM to assist in isolating the part of
the code responsible for automatic title generation triggering and
generating a portion of the code I am posting here. I have thoroughly
understood, checked, and tested the code which I am submitting manually,
and take full professional responsibility for its quality. I have added
a `Signed-off-by` section to my commit message to indicate my signing
off, and a `Co-Authored-By` section to indicate LLM use.

**No LLM was used in the writing of this PR text or commit message.**

Thank you! Please let me know if you want me to change anything.

---

Release Notes:

- Feature: Added a configuration option to disable automatic title
generation for agent threads

---------

Signed-off-by: Frederick Morlock <me@freddy.us>
Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-11-06 19:51:13 +00:00
scarf e231594b6b git: Add date format and per-view date style settings (#66533)
## Summary

resolves #15272, take 2 of #58950
tl;dr: add following options:

```json
{
  "git": {
    "date_format": "locale", // "locale" (default), "iso", or a strftime format like "%Y-%m-%d %H:%M"
    "blame":         { "date_style": "relative" },
    "inline_blame":  { "date_style": "relative" },
    "branch_picker": { "date_style": "relative" },
    "stash_picker":  { "date_style": "relative" }
  },
  "git_panel": { "date_style": "relative" },
  "git_graph": { "date_style": "absolute" }
}
```

design per
https://github.com/zed-industries/zed/pull/58950#issuecomment-6017682621,
also pinging @smitbarmase per request

## Testing

screenshots are taken on fedora linux 44 + kde plasma 6.7.5

<img width="2560" height="1440" alt="image"
src="https://github.com/user-attachments/assets/0784f1f7-0e00-4be5-893d-775d617b33e4"
/>
<img width="1125" height="937" alt="image"
src="https://github.com/user-attachments/assets/7ae6c876-3a93-4876-a151-85632d54d982"
/>
<img width="1407" height="340" alt="image"
src="https://github.com/user-attachments/assets/2178804a-444b-4613-9024-3700b15e0cfe"
/>

changed each config values `Date Format {locale/iso/strftime} x Date
Style {relative/absolute}` and they all seem to work without issues
also, invalid date format will default to `locale` (with an warning log
like below)
```
2026-11-05T00:14:08+09:00 WARN  [project::project_settings] Invalid git.date_format: invalid component name `Q` at byte index 1
```

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Added `git.date_format` and per-view `date_style` settings for git
dates

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-11-06 14:35:38 +00:00
chrisknsmn 4814ef66aa Document how preferred_line_length affects Rewrap (#66534)
Closes #47449

## Summary

The docs for `preferred_line_length` only describe soft wrap, but the
setting also controls the column `editor::Rewrap` wraps to, even when
soft wrap is off. This adds that to the setting's entry in
`all-settings.md` and to its comment in `default.json`.

The old description also appears in
`crates/settings_content/src/language.rs` and
`crates/settings_ui/src/page_data.rs`. I left those alone to keep this
docs-only, but I'm happy to update them too if you'd like.

## Testing

Tested on macOS with Zed 1.26.2, the installed release, since this PR
only changes docs and a comment.

1. Add these settings:
   ```json
   "languages": {
     "Plain Text": {
       "preferred_line_length": 40,
       "soft_wrap": "none"
     }
   }
   ```
2. In a `.txt` file, paste one long line of text with spaces and run
`editor: rewrap`. It wraps at column 40.
3. Undo, change `soft_wrap` to `editor_width`, and run `editor: rewrap`
again. It still wraps at column 40.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist). (N/A: no UI
changes)
- [ ] Tests cover the new or changed behavior. (N/A: docs and comment
only)

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-11-05 07:57:51 +00:00
Ahmed Tajelsir 504abf602a feat: config to toggle edit prediction button in the status bar (#66450)
## Summary

Resolves https://github.com/zed-industries/zed/discussions/26095


https://github.com/user-attachments/assets/fca26dcc-e526-4e69-b611-4b3cdcc91066

## Testing

Manually test your changes; report results, mention platforms if
relevant.
How can reviewers test this easily? Include setup and steps.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.

Release Notes:

- Added an `edit_predictions.button` setting to toggle the edit
prediction button in the status bar
2026-11-03 09:14:29 +00:00
Piotr Osiewicz 00b86477f8 debugger: Allow configuring the default panel size (#66435)
Closes #66412

Add `debugger.default_width` for left/right docking and
`debugger.default_height` for bottom docking, along with controls in the
Settings Editor. Both default to 300 pixels, preserving the existing
default size.

## Testing

- All 22 debugger panel tests and 76 Settings Editor tests pass.
- Built and visually checked the Settings Editor on macOS with defaults
of 300/300 and custom values of 495/275 after relaunch.
- Rust formatting, documentation formatting, and `git diff --check`
pass.

Release Notes:

- Added support for configuring the debugger panel’s default size via
`debugger.default_width` and `debugger.default_height`.

Co-authored-by: Amp <amp@ampcode.com>
2026-11-02 17:27:20 +00:00
Andriy Massimilla 5a534d7b5d git: Add git auto fetch (#53089)
## Summary

Adds an opt-in periodic background `git fetch --all` for local
repositories, so remote-tracking branches and ahead/behind counts stay
current without a manual fetch.

Because the fetch runs unattended, it behaves differently from a
user-initiated fetch:

- **Trusted repositories only.** Re-checked on every tick, since a
worktree can be trusted or restricted at any point in a session.
- **Never prompts.** Credentials that need no interaction (e.g. an SSH
agent, or a credential helper answering from a keychain) still work.
Anything that would need input fails instead of blocking on a prompt
nothing will answer.
- **Silent.** No activity indicator in the status bar, since a spinner
every minute is noise. Failures are logged at debug level.
- **Stays out of the user's way.** It runs off the repository's serial
job queue, so status refreshes and staging aren't stalled behind the
network. A user-initiated fetch, pull, or push preempts an in-flight
background fetch rather than waiting for it.
- **Leaves the repository clean when stopped.** Stopping a fetch (a
settings change, preemption, closing the project) asks git to terminate
so it can remove its ref lockfiles, rather than killing it and leaving a
stale `.lock` behind that breaks every later fetch. It also never
triggers auto-maintenance on the user's behalf.

## Configuration

```json [settings]
{
  "git": {
    "auto_fetch": {
      "enabled": false,
      "interval_secs": 60
    }
  }
}
```

- `enabled` (default `false`): whether to fetch from all remotes in the
background.
- `interval_secs` (default `60`, clamped to a minimum of `15`): how
often to fetch.

Both are exposed in the settings UI under **Version Control > Git
Integration**, where the interval is only shown while auto-fetch is
enabled, and documented in `docs/src/reference/all-settings.md`.
Unrelated settings changes don't restart the timer.

## Implementation design

### `GitCaller`

The remote-capable `GitRepository` methods (`fetch`, `pull`, `push`,
`commit`) take a `GitCaller` instead of a bare `AskPassDelegate`:

```rust
pub enum GitCaller {
    /// A user started this and is waiting on it. Prompts route to the UI.
    User(AskPassDelegate),
    /// No user attached. Never prompts, and stops when the receiver resolves.
    Background(Option<oneshot::Receiver<()>>),
}
```

Every such command goes through `GitBinary::run_remote_command`, which
applies everything the caller implies. git, credential helpers, and ssh
each prompt through a different mechanism, so keeping the list in one
place means no call site can miss one. For `Background`:

| Prompt channel | Mitigation |
| --- | --- |
| git's own terminal prompt | `GIT_TERMINAL_PROMPT=0` |
| Credential helpers | `credential.interactive=false`, which is narrower
than clearing `credential.helper` so helpers that answer without
prompting keep working |
| askpass | `core.askPass=`, and `GIT_ASKPASS`/`SSH_ASKPASS` unset |
| ssh (key passphrases, host key confirmation) | `-o BatchMode=yes`
composed onto the ssh command git would otherwise use
(`GIT_SSH_COMMAND`, then `core.sshCommand`, then `ssh`), so custom ssh
commands keep working. Setups that only set the deprecated `GIT_SSH` are
left alone, since setting `GIT_SSH_COMMAND` would silently replace them.
|

`gc.auto=0` is also set, since auto-maintenance can repack the whole
repository. gpg's pinentry when signing isn't covered, as no background
caller signs.

### Cancellation

A background command is spawned with `kill_on_drop` and raced against
its cancel receiver, where a dropped sender counts as cancellation:

1. If already cancelled before spawning, git is never started.
2. On cancellation, git is sent `SIGTERM`
(`util::process::request_termination`), which runs its handlers that
remove lockfiles.
3. If it hasn't exited within a 2s grace period, it's killed.

Windows has no equivalent signal, so cancellation there is a kill.

### Scheduling

- Each repository has a timer task, restarted only when `enabled` or
`interval_secs` change.
- On each tick, the timer checks trust, then tries to acquire the
repository's `fetch_lock` semaphore and skips the tick if it's held. It
spawns a **detached** fetch task that holds the permit until the fetch
settles.
- `AutoFetchState.cancel` holds the sender, and is the only thing
bounding the fetch's lifetime. It's dropped on a settings change, on
preemption, and when the repository is dropped, so every way of stopping
a fetch goes through graceful cancellation.
- Running off the serial job queue is safe because auto-fetch mutates no
`Repository` state. It only updates remote-tracking refs, which git
guards with its own lockfiles, and the results reach the UI via the
resulting git directory rescan. Manual fetch stays on the queue, since
it also writes snapshot state via `refresh_branch_list`.
- `fetch`, `pull`, and `push` call `preempt_auto_fetch()`, which drops
the cancel sender, then wait on `fetch_lock` inside their job. That wait
is bounded by a cancelled fetch shutting down rather than by the
network, and stops them failing with "cannot lock ref" against a
background fetch.

## Test plan

`test_auto_fetch` covers:

- [x] An untrusted repository is never auto-fetched, and fetching begins
once its worktree is trusted
- [x] Timer fires on schedule, and again on the following interval
- [x] Unrelated settings change mid-interval doesn't reset the timer
- [x] Disabling `auto_fetch` stops all fetches
- [x] Re-enabling with a longer interval respects the new cadence

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

Addresses
#24611(https://github.com/zed-industries/zed/discussions/24611)

Release Notes:

- git: Added option (off-by-default) to automatically fetch upstream of
the current branch and default upstream of the project. Enable it with:
```
{
  "git": {
    "auto_fetch": {
      "enabled": false,
      "interval_secs": 60
    }
  }
}
```.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Codex (GPT-6) <noreply@openai.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-10-29 10:48:05 +00:00
Kirill Bulatov 5d47f83542 Allow opening README files by default (#65389)
Closes https://github.com/zed-industries/zed/discussions/38228


https://github.com/user-attachments/assets/4f80a4a8-8e4a-499b-b51f-4d389fe1f781

Release Notes:

- Added a way to open README files by default, use `"on_new_window":
"readme",` to configure
2026-10-22 09:26:30 +00:00
Chinmay Talnikar d7adf3e7e2 project_panel: Add extension sort order (#65776)
Adds an `extension` value to `project_panel.sort_order` so files with
the same extension appear consecutively.

- Files are grouped by lowercased last extension in ascending order
(`foo.tar.gz` groups under `gz`).
- Extensionless files and dotfiles come first.
- Within a group, names use the existing natural sort.
- `sort_mode` still controls directories vs. files. Directories count as
having no extension so `mixed` mode keeps a consistent (transitive)
ordering.

Includes unit tests in `util`, a panel-level test, a benchmark entry,
and settings/docs updates.

Release Notes:

- Added an `extension` option to `project_panel.sort_order` that groups
files by extension

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-10-21 08:48:46 +00:00
Matthew 2d4c483194 gpui_apple: Display P3 option for MetalRenderer's colorspace (#64394)
# Objective

Add an optional Display P3 support for macOS metal_renderer. The idea
for the change originates from the Ghostty's setting `window-colorspace
= display-p3' which slightly enhances even BGRA8Unorm colors.

Closes #8293
## Solution

- Added an option to the settings, marked it as `(macOS only)`. The
option is `Display P3` in the UI and `use_display_p3` in the config.
- Modified `metal_renderer.rs` to create a native colorspace object and
made it be used by the created MetalRenderer.

## Testing

Manually tested on Macbook M4 Pro (supports wide gamut). 
I believe, it needs no specific tests as long as they are no dedicated
tests for creating MetalRenderer

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior --- See Testing section
- [x] Performance impact has been considered and is acceptable

## Showcase

<img width="1512" height="982" alt="p3shot-2026-09-17-191715"
src="https://github.com/user-attachments/assets/548a208c-e5c0-4cfe-8fff-47368885cc4a"
/>

---

Release Notes:

- Added support for P3 color space on macOS (`use_display_p3` in
options).
- [GPUI] Added support for P3 color space to Metal renderer (macOS
only).

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Amp <amp@ampcode.com>
2026-10-16 17:00:17 +00:00
sebascadpi ef376006f3 tab_switcher: Add setting to disable file preview (#56235)
Closes [#45068](https://github.com/zed-industries/zed/issues/45068)

I added a setting that allows for files to not be displayed in the
editor while cycling through the tab switcher, it personally caused me
some confusion when I had to switch from one file to another and I was
shown other files' code I didn't care about, so I thought it would be
nice to have an option for only displaying the selected tab when you
release the ctrl key. See:


[zed-show_file_preview_false.webm](https://github.com/user-attachments/assets/3e49a253-2add-4e68-add6-08ecd1c81d01)

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

Release Notes:

- Added `tab_switcher.show_file_preview` setting to control whether
files previews are shown while cycling through the tab switcher (the
default behavior is true)

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Amp <amp@ampcode.com>
2026-10-13 12:01:51 +00:00
Sha1rholder ef33e891bf Make mermaid diagram font family configurable (#63430)
# Objective

Fix #63428

## Solution

Add a settings option `"mermaid_font_family"` to allow escape from
`"ui_font_family"`. Does not affect any default behavior.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<img width="2426" height="1456" alt="Image"
src="https://github.com/user-attachments/assets/70ec2ae3-a184-4523-bce2-272c8f33b840"
/>

<img width="1838" height="668" alt="image"
src="https://github.com/user-attachments/assets/93711957-8f9c-42cd-afc0-a1ac84f1d7a3"
/>

Release Notes:

- Make mermaid diagram font family configurable to fix #63428

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Amp <amp@ampcode.com>
2026-10-06 12:47:57 +00:00
Audi Nugraha e7c8cbeed6 extensions_ui: Add extension_suggestions setting to disable extension suggestions (#65109)
## Summary

Zed shows a notification suggesting extensions for the languages of the
files you open. Right now the only way to silence it is to dismiss each
suggestion one by one (stored per extension), or to add every extension
to `auto_install_extensions`. There is no way to turn the feature off as
a whole.

This adds an `extension_suggestions` setting (default `true`). When set
to `false`, `show_suggestion` returns early and no suggestion
notification is shown.

```json
{
  "extension_suggestions": false
}
```

To make the feature discoverable, this also:

- Adds an **Extension Suggestions** toggle to the General settings page.
- Adds a third **Never Suggest Extensions** action to suggestion
notifications that disables the setting globally.

Changes: `ExtensionSettingsContent` / `ExtensionSettings` get the new
field (non-optional `bool` with `serde(default_true)`),
`assets/settings/default.json` and `docs/src/reference/all-settings.md`
document it, `settings_ui` renders the toggle on the General page,
`MessageNotification` gains support for a tertiary action, and
`extension_suggestions.rs` checks the setting and wires up the new
notification action.

## Testing

- Added `test_no_suggestion_when_extension_suggestions_disabled` (opens
`index.html` with the setting off, expects no notification).
- Added
`test_disabling_extension_suggestions_persists_and_stops_suggestions`
(invokes the new action, asserts the setting is disabled and no further
suggestions appear).
- `cargo test -p extensions_ui extension_suggestions`: 22 pass, 2 fail.
The 2 failures (`test_suggestion_returns_after_uninstall`,
`test_suggestion_returns_after_failed_install`) also fail on `main`
without this change.
- Manually checked on macOS with a local release build: the General →
Extensions toggle works, and the **Never Suggest Extensions** action
disables the setting globally.

To test: toggle it off in Settings → General → Extensions, or click
**Never Suggest Extensions** on a suggestion notification, then open a
file whose language has a suggested extension.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Added an `extension_suggestions` setting to turn off extension
suggestions.

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: MrSubidubi <finn@zed.dev>
Co-authored-by: Finn Evers <finn.evers@outlook.de>
2026-10-05 16:40:35 +00:00
PleahMaCaka cad56bd65a languages: Stop treating .env files as shell scripts (#64242)
# Objective

Closes #58584. `.env` files are classified as Shell Script, so Zed runs
`bash-language-server` on them and `shellcheck` [reports SC2034 on every
line](https://github.com/zed-industries/zed/issues/58584#issuecomment-4625839715).

## Solution

Add an `Env` language that reuses the Bash grammar and registers no LSP
adapters, so highlighting stays and no language server starts. `.envrc`
remains Shell Script, since direnv executes it as shell.

#7124 mapped `.env` to Shell Script for highlighting and
`redactions.scm`, not for linting. `Env` keeps both and only drops the
language server.

## Testing

- By hand on Windows with `shellcheck` on `PATH`: a `.env` reports 18
SC2034 warnings before and none after.
- Unit test covers the `.env` / `.envrc` / `.sh` classification.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<details>
  <summary>Click to view showcase</summary>

<img width="811" height="841" alt="Group 1"
src="https://github.com/user-attachments/assets/fe05e884-e915-420d-a0ba-4075fef8a3d3"
/>

</details>

---

Release Notes:

- Fixed `.env` files being treated as shell scripts, which made
`shellcheck` report SC2034 on every line. ".env" files now use a
separate Env language.
2026-10-05 10:24:44 +00:00
Arti 708c7eef55 file_finder: Implement SeedQuerySetting::Selection seed_query (#64946)
## Summary

UX parity with JetBrains IDEs: there, you can
- select a file name/path in the terminal/editor
- press the "open file finder" hotkey
- see search results for that file

On Zed's main branch, you have to:
- select a file name/path in the terminal/editor
- press ctrl+c / ctrl+shift+c (depending on the context)
- press the "open file finder" hotkey
- see the default list of files for an empty search
- press ctrl+v
- see search results for that file

The issue is little one but it is a "death by a thousand cuts" type of
straw for me.


https://github.com/user-attachments/assets/26de5bba-98c2-4a1f-8540-1e0e646301e8

The feature can be disabled in the `settings.json` with the
`file_finder.prefill_query_from_selection` flag set to `false` or in the
settings UI page for file finder.

## Testing

To test this, a reviewer can:
- open any project
- select a file name/path in the terminal/editor
- press the "open file finder" hotkey
- see search results for that file

Then switch the checkbox in the file finder setting page (or set
`file_finder.prefill_query_from_selection` to `false` in settings.json)
and:
- select a file name/path in the terminal/editor
- press the "open file finder" hotkey
- see the default list of files for an empty search

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.


Zed already has a `seed_query` mechanism for `text_finder`, built on
`SeedQuerySetting::Selection` and
`SearchableItemHandle::query_suggestion`, which I reused as much as
possible.

`FileFinder::seed_query` basically duplicates
`TextFinder::active_item_query` code (except checking if the setting is
disabled).

I wanted to unify the functionality but did not know where the new
unified method would fit better and decided that some code duplication
is not as terrible as bad refactor (if any reviewer can tell me a proper
place to put the method to get selected text for search query I will be
very thankful).

Ran every existing test (- each passed) and asked LLM generate new ones
for this PR (reviewed them and can vouch that they make sense)

Release Notes:

- Improved the file finder to pre-fill the search query with the text
selected in the terminal/editor
- [GPUI] Added a method for retrieving the selected text from any
registered input handler

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-10-03 00:28:21 +00:00
mulham c83abe7d0e git_ui: Allow collapsing the commit editor and commit details (#63236)
## Summary

- The commit message editor in the Git panel is pinned to six lines and
its only two controls both make it *larger* — one fills the panel, the
other opens the modal. Anyone who commits from a terminal pays for an
input they never use, and the Changes list is what gets squeezed.
- In the Git Graph detail panel, the author metadata and the commit
message render at a fixed size above the changed-files list, so
shortening the panel (e.g. dragging the terminal up) hides the file list
entirely.

## Changes

**Git panel — collapsible commit editor**

- New `git::ToggleCommitEditor` action.
- A chevron beside the commit button hides the editor down to a thin
bar; the commit button row stays available.
- State persists per workspace via `SerializedGitPanel`, seeded from a
new `git_panel.commit_editor` setting (`expanded` | `collapsed`, default
`expanded`).
- Collapsing clears the fill state — a hidden editor cannot also fill
the panel.
- `activation_focus_handle` no longer focuses an editor that isn't
rendered.

**Git Graph — collapsible commit details**

- A disclosure folds the author metadata (avatar, refs, email, SHA,
provider link) down to a single author + short-sha line.
- A second disclosure folds the commit message body.
- The changed-files container is already `flex_1().min_h_0()`, so it
reclaims the freed space with no other layout change.

**Settings plumbing**

- `GitPanelCommitEditor` in `settings_content`, wired through
`GitPanelSettings`, `assets/settings/default.json`, the settings UI, and
`docs/src/reference/all-settings.md`.

## Test plan

- [x] `test_toggle_commit_editor_collapsed` added, covering the toggle,
persistence of the flag, and the fill/collapse exclusion.
- [x] Manually verified in a dev build: chevron hides and restores the
editor, Changes list expands into the freed space, action appears in the
command palette, state survives a restart, and the `collapsed` setting
seeds a new workspace.
- [x] Manually verified both disclosures in the Git Graph detail panel
with the panel shortened, including that the collapse state survives
selecting a different commit.

Release Notes:

- Improved the Git panel by allowing the commit message editor to be
collapsed, and the Git Graph commit details by making the metadata and
commit message sections collapsible.

### Evidance Test
| Expand | Collapse | Settings Git Panel |
| ------- | --------- | ------------------ |
| <img width="675" height="965" alt="Screenshot 2026-08-26 at 15 00 46"
src="https://github.com/user-attachments/assets/70c56d02-35fc-45ac-988c-24ccd6d1a19e"
/> | <img width="661" height="962" alt="Screenshot 2026-08-26 at 15 00
57"
src="https://github.com/user-attachments/assets/2c32fa5d-30fc-4f35-8323-afbc2a031210"
/> | <img width="1041" height="956" alt="Screenshot 2026-08-26 at 16 50
40"
src="https://github.com/user-attachments/assets/67f166b6-5cd9-4430-bba3-fa765715c557"
/> |

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-10-02 17:25:11 +00:00
Bennet Bo Fenner 309f91f564 copilot: Move enterprise URI to top-level setting (#65082)
This PR is moving the `enterprise` URI to a top level `copilot` settings
because it is used for both Edit Predictions and Copilot Chat.
Previously it was listed under `languages > copilot > enterprise_uri`

Release Notes:

- N/A
2026-10-02 11:22:04 +00:00
Finn Evers 5c5236ded8 Remove descriptive comments in default settings (#65077)
This PR removes two comments from the default settings, as these merely
describe the sorting of the keys to follow and do not provide much
context/help for users browsing our default settings.

## Self-review

- [X] I've reviewed my diff for quality, security, reliability, and
performance.
- [-] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [-] Tests cover the new or changed behavior.

Release Notes:

- N/A
2026-10-02 09:45:58 +00:00
andrew 28d5832adb markdown_preview: Add heading_font_weight setting (#64421)
Headings in the Markdown preview are hardcoded to semibold (600). Users
who set a lighter UI font, or who simply prefer lighter headings, have
no way to change this.

This adds `markdown_preview.heading_font_weight`, applied to H1 through
H6 in the preview. It defaults to `600`, so existing rendering is
unchanged unless the setting is set.

```jsonc
{
  "markdown_preview": {
    "heading_font_weight": 500
  }
}
```

The value flows through `ThemeSettings` alongside the existing preview
typography settings, so the generic `markdown` crate gains no dependency
on `markdown_preview`. Because notebook Markdown cells share the preview
typography, they follow the setting too. Bold text inside headings and
table header cells keep their own weights. The setting is also exposed
in the settings editor under Markdown Preview Font, and documented in
the visual customization docs.

## Before / after

| Default (`600`) | `"heading_font_weight": 500` |
| --- | --- |
| <img width="2000" height="1299" alt="heading-weight-600-default"
src="https://github.com/user-attachments/assets/403d29bb-34ed-4cb1-b333-920ec5ee65f0"
/> | <img width="2000" height="1299" alt="heading-weight-500"
src="https://github.com/user-attachments/assets/9fbdd7f9-2d56-4815-a39e-fd1325ba7cd2"
/> |


## Testing

- New tests in `crates/markdown` assert every preview heading level
resolves to `600` by default and to the configured weight when set, and
that the weight does not leak into editor or agent Markdown.
- Verified manually in a dev build with `SF Pro` at weights 500 and 600;
the open preview re-renders on settings save.

Release Notes:

- Added `markdown_preview.heading_font_weight` to configure the font
weight of headings in the Markdown preview.
2026-10-02 08:35:39 +00:00
Daniel Strobusch 54edefa083 Sort built-in agent profile tool keys in default profiles (#65022)
## Summary

It allows quick comparison (diff) to custom profiles.

## Testing

Manually test your changes; report results, mention platforms if
relevant.
How can reviewers test this easily? Include setup and steps.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.

Release Notes:

- N/A

Signed-off-by: Daniel Strobusch <1847260+dastrobu@users.noreply.github.com>
2026-10-02 08:22:43 +00:00
Hazi c821538b57 agent: Add configurable idle thread retention (#64547)
## Objective

Add a configurable limit for idle, loadable agent threads retained in
memory.

Previously, a thread that was still running when the user switched away
from it was retained correctly, but was not reconsidered for unloading
after it completed. It could remain loaded until a later cleanup
trigger.

## Solution

- Add the `agent.max_idle_retained_threads` setting, defaulting to `5`.
- Re-run retained-thread cleanup when a retained ACP thread transitions
to `Idle`.
- Remove retained-thread status subscriptions when their thread is
unloaded or reactivated.
- Add regression coverage for unloading a retained thread after it
completes when the limit is `0`.

## Testing

- Added a GPUI regression test covering a running thread that is
retained, completes, and is then unloaded with:

  ```json
  {
    "agent": {
      "max_idle_retained_threads": 0
    }
  }
  ```

## 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 adheres to Zed's UI standards
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added a setting to control how many idle agent threads remain loaded.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-09-28 16:16:26 +00:00
AdinAck 408c713a35 settings default: Allow rewrap for Typst (#64858)
## Summary

Allows the "editor: rewrap" action for Typst content.

## Testing

Built locally, tested in `.typ` files, works!

## Self-review

This change is trivial, not much to review!

Release Notes:

- Changed settings defaults to allow rewrapping for Typst

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-09-28 16:11:38 +00:00
Paul Di Pietro 8a4fd5704c title_bar: Add an option to open menus on hover (#48496)
Closes #45603 

I wanted to open this and start a conversation/get some feedback after
encouragement from people in the above discussion. Currently, the
enabled `show_menus` setting causes them to open when hovered over,
which generally breaks with a longstanding user expectation for desktop
applications. It could be argued that this behavior shouldn't exist at
all, but it's of course possible that some people prefer it. To that
point, I explored adding an additional option, `show_menus_on_hover`,
which is disabled by default.

This also checks as to whether any menu is in use so that clicking a
menu and then navigating through them opens them accordingly. As
mentioned in the discussion, this doesn't address an existing bug where
some of the pane icons will blink while moving through the menus.

I'm unsure of how this specifically can or should be tested since I'm
learning as I go, so for now there's just screenshots from the
aforementioned discussion. I'm open to suggestions. As I'm sure some
might guess, these changes don't really apply to macOS as the menus are
always visible. I also do not have access to a Windows installation at
this point.

(Tested in Arch Linux / KDE Plasma 6.5.5; ran the release build to take
clips)


![hover-on](https://github.com/user-attachments/assets/6601f927-ef68-4d24-b05b-c442ecc87137)

![hover-off](https://github.com/user-attachments/assets/716e79e2-5a84-41df-a394-acfbac59b2be)
<img width="1380" height="752" alt="setting"
src="https://github.com/user-attachments/assets/7a3614ae-d5fd-4767-9ca4-330c91e40bcc"
/>

Release Notes:

- Changed title-bar menus to require a click before opening. Enable
`title_bar.open_menus_on_hover` to open them on hover instead.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-09-28 09:30:00 +00:00
Aru Sahni 4f70d91bda editor: Add support for customizable soft wrap indentation (#63468)
# Objective

- Soft wrapped lines currently inherit the indentation of their first
line. This can be challenging for those coming from different editors,
or with different expectations.
- Allow users to customize the soft wrap behavior to wrap with extra
indent, or no indent at all.
- Fixes #18687

## Solution

- Introduce 3 soft-wrap indent configuration values (in addition to the
default of `same`): `none`, `extra_one`, and `extra_two` (where they are
multiples of the indent column width).
- Plumb indent configuration through to the various gpui and editor
components that are concerned with wrapping.
- Update code action icon placement to accommodate `none`-level wrap
indentation (preceded by a refactor of the function used to calculate
its display row).
- Fixed an existing bug in `WrapSnapshot::soft_wrap_indent` where
querying a 0-indent wrap returned `None` instead of `Some(0)`

## Testing

- Added tests to `wrap_map.rs` for all indentation levels.
- Updated the random wrap tests to include indent setting combinations. 
- Added tests for code action icon placement. 
- Validated locally by toggling between the various settings and
observing how the wrap behaved.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

Changes are grouped by commit to ease review.

Screenshots below!

<details>
  <summary>Click to view showcase</summary>

**`same` indent** (current Zed behavior)
<img width="764" height="844" alt="Screenshot from 2026-08-02 22-45-54"
src="https://github.com/user-attachments/assets/83e1465c-0e8e-445d-a172-9e1b446406b7"
/>

**`none` indent**
<img width="764" height="844" alt="Screenshot from 2026-08-02 22-45-39"
src="https://github.com/user-attachments/assets/99b282b6-d308-453d-b08b-e10af824f307"
/>

**`extra_one` indent**
<img width="764" height="844" alt="Screenshot from 2026-08-02 22-46-06"
src="https://github.com/user-attachments/assets/c7480c84-f1a2-485d-b831-b97fe55c0b03"
/>

**`extra_two` indent**
<img width="764" height="844" alt="Screenshot from 2026-08-02 22-46-19"
src="https://github.com/user-attachments/assets/badc4996-e1bf-4237-9add-babf08f13897"
/>

**the setting**
<img width="826" height="336" alt="Screenshot from 2026-08-02 22-42-19"
src="https://github.com/user-attachments/assets/906b4e8e-1366-4a4e-a2cf-4f8bd67fd604"
/>


</details>

---

Release Notes:

- Added a `soft_wrap_indent` setting (`"none"`, `"same"`, `"extra_one"`,
`"extra_two"`) to configure indentation for soft-wrapped continuation
lines.
- Fixed soft-wrap continuation line indentation calculation for
unindented lines starting at column 0.
- [GPUI] Added `IndentAdjustment` enum to `LineWrapper` to control
indentation of soft-wrapped continuation lines.

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-09-28 07:16:22 +00:00
Dom Porada 63b29c2edd Add support for the "..." entry in terminal.path_hyperlink_regexes (#64552)
## Objective

Allow custom terminal path regexes to extend inherited entries without
copying them. This PR also corrects the existing mismatch between the
documented and shipped default regexes.

This is the last submission in the #64399 series, following #62769,
#64222, #64440, #64484, and #64540.

## Solution

The `"..."` entry is intentionally supported at the top level only. A
`"..."` line inside a multiline entry remains regex text. Existing
configurations that use bare `...` as a three-character regex can
preserve that behavior by writing `["..."]` as an entry instead.

The shipped regexes and hyperlink matching behavior are unchanged.

## Testing

All focused tests and all hyperlink tests pass on macOS. The documented
default expressions were checked against the shipped values.

## 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 adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Added support for `"..."` in `terminal.path_hyperlink_regexes` to
extend inherited regexes without repeating them.
2026-09-21 16:10:07 +00:00
Josh Kent 36726df0c3 sidebar: Group threads sidebar settings (#64395)
## Objective

Group the threads sidebar settings together in JSON and the Settings
Editor, using consistent “Threads Sidebar” terminology.

This follows up on #63452 now that #62883 has added configurable default
width, and includes the auto-open setting added since then.

## Solution

- Group `position`, `default_width`, and `auto_open` under
`agent.threads_sidebar`, and display their controls together in
Settings.
- Automatically migrate `agent.sidebar_side`,
`agent.threads_sidebar_default_width`, and
`agent.threads_sidebar_auto_open` across supported settings scopes,
preserving existing nested values.
- Apply changes to the default width immediately, including when the
sidebar was manually resized, and clear the saved width override.
Unrelated settings changes preserve manual sizing.
- Document all three settings, including the previously missing position
entry.

## Testing

The following targeted checks passed on the local changes:

- `cargo test -p migrator nest_agent_threads_sidebar_settings` — 7 tests
passed.
- `cargo test -p sidebar -p workspace -p agent_settings -p gpui_platform
--features gpui_platform/runtime_shaders --lib -- width
threads_sidebar_settings test_open_directory_in_existing_window` — 9
tests passed.
- `cargo fmt --all` completed successfully.
- `git diff --check` passed.
- From `docs`: `npx prettier --check src/reference/all-settings.md
src/ai/parallel-agents.md` passed.

Coverage includes migration precedence and supported scopes, settings
defaults and width limits, manual sizing and resets, persisted widths,
and auto-open behavior.

Full application tests and manual UI testing were not run. Clippy was
not rerun after the final terminology changes.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Improved threads sidebar settings by grouping position, default width,
and auto-open together, and applying default-width changes even after
manual resizing.
2026-09-21 15:15:54 +00:00
Dom Porada 4c7f3574f2 Add support for "..." in edit_predictions_disabled_in (#64546)
## Objective

Let projects and language-specific settings add scopes where edit
predictions are disabled without repeating inherited scopes.

Part of #64399.

## Solution

Extend the `"..."` convention from #62769, #64222, #64440, #64484, and
#64540 to `edit_predictions_disabled_in`. For example, a global
`["comment"]` and a language override of `["string", "..."]` disable
predictions in both scopes.

Inherited scopes are inserted at `"..."`, and duplicates keep their
first occurrence. Omitting the marker replaces the list, `[]` clears it,
and omitting the setting preserves inheritance. The default remains
`[]`.

## Testing

Tested on macOS through settings loading, covering project and
language-specific overrides, inheritance, replacement, and clearing. The
language settings tests passed. Live editor behavior has not been
checked manually.

To check manually, configure global `["comment"]` and a language
override of `["string", "..."]`. Confirm predictions are disabled in
both scopes, then remove `"..."` and repeat with `[]` to check
replacement and clearing.

## 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 adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Added support for `"..."` in `edit_predictions_disabled_in` so project
and language-specific settings can extend inherited scopes.

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-09-21 14:24:18 +00:00
Dom Porada 5a137cbc9b Add support for "..." in edit_predictions.disabled_globs (#64540)
## Objective

Let users and projects add edit prediction exclusion patterns without
repeating defaults or inherited patterns.

Part of #64399.

## Solution

Extend the `"..."` convention from #62769, #64222, #64440, and #64484 to
`edit_predictions.disabled_globs` using `SplicingVec`. Inherited
patterns are inserted at `"..."`, and duplicates retain their first
occurrence. Omitting the marker replaces the list, `[]` clears it, and
omitting the setting preserves inheritance.

Opening an absent setting now initializes it with `["..."]` instead of
clearing inherited patterns, and the selection is located by parsing the
JSON instead of a regex, so a commented-out or nested `"disabled_globs"`
can no longer capture it. Cursor imports append `"..."` like the
`files.exclude` import does, so Zed's sensitive-file defaults survive an
import; empty lists and empty or literal `"..."` entries are dropped,
matching `enabled_patterns`.

## Testing

Tested on macOS with settings merge and loading tests, Cursor import
tests, the UI settings update and selection path (including
commented-out and nested decoy keys), the new `settings_json` key-path
lookup, and Copilot integration coverage.

To check manually, configure custom disabled patterns alongside `"..."`
and confirm that both custom patterns and inherited sensitive-file
patterns remain disabled. Repeat without `"..."` and with `[]` to verify
replacement and clearing. Opening the setting when it is absent should
preserve inherited patterns.

## 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 adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Added support for `"..."` in `edit_predictions.disabled_globs` so
custom patterns can extend inherited exclusions, and fixed "Configure
Excluded Files" selecting the wrong list when a commented-out
`disabled_globs` precedes it.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-21 13:08:53 +00:00
Smit Barmase 534319bd05 which_key: Improve pending keystrokes indicator to include untimed chords (#64362)
Closes #64338

The pending keystrokes indicator now shows chords without a timeout,
with no countdown circle. For example, pressing `cmd-k` shows that Zed
is waiting for another key.

Few cases which needed special handling for untimed chords case:

- Hovering already pauses a timed chord, and GPUI preserves that pause
when the chord advances. An untimed chord has no paused timeout to carry
forward. We pause its newly created timeout if the pointer is still over
the indicator or popover.
- For timed chords, the timeout already stays paused during the
popover's 300 ms dismissal delay. If an untimed chord gains a timeout
during that delay, it now follows the same rule. The popover still
closes at the original deadline, then the timeout resumes with a full
second remaining.

<img width="308" height="182" alt="CleanShot 2026-09-17 at 11 45 33
AM@2x"
src="https://github.com/user-attachments/assets/9baa5fde-de9b-447d-9b02-b712a3065685"
/>

Release Notes:

- Improved the pending keystrokes indicator to show chords without a
timeout, such as shortcuts starting with `cmd-k`.
2026-09-17 09:17:09 +00:00
Jack Walters 52e0b848da 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
2026-09-16 16:03:50 +00:00
Ashraf Hossain 95c0d74be9 Fix accidental /// comments and a docs typo (#64287)
## Objective

Fix small comment/docs typos left out of #64282.

## Solution

- Replace accidental Rust-style `///` comments with `//` in
`assets/settings/default.json` (`git_panel.tree_view` and
`git.gutter_debounce`)
- Fix typo in `docs/src/visual-customization.md`:
`"enable_language_server" if false` ? `is false`

## Testing

Comment/docs-only changes; no runtime behavior change.

---

Release Notes:

- N/A

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:53:40 +00:00
Dom Porada aef893e276 Add a setting for the Threads Sidebar width (#62883)
## Objective

The Threads Sidebar opens at a hard-coded 300px and can be resized only
by dragging. `agent.default_width` controls the Agent Panel rather than
the sidebar, leaving no way to configure the sidebar’s preferred width.

## Solution

Add `agent.threads_sidebar_default_width` for the width used when no
user-chosen sidebar width is stored. The value is clamped to the
existing 200–800px drag range. Existing, unresized sidebars follow
settings changes immediately. Double-clicking the divider resets the
sidebar to the configured width and resumes following subsequent
settings changes.

The sidebar previously saved its width whenever any sidebar state
changed, not only when the divider was dragged. `SerializedSidebar` now
records `width_set_by_user`, so settings-driven widths are no longer
persisted. Manually resized widths take precedence until the divider is
reset.

## Testing

- `test_threads_sidebar_default_width` in
`crates/agent_settings/src/agent_settings.rs` covers the default, a user
override, fallback for `null` and an unset field, and preservation of
the Agent Panel width and sidebar position.
- Five width-focused tests in `crates/sidebar/src/sidebar_tests.rs`
cover reset behavior, live settings updates, clamping, legacy-width
restoration, and persistence. They also check that manually resized
widths resist settings changes and that resetting resumes following the
setting.
- To check by hand: set `"agent": { "threads_sidebar_default_width": 360
}`, reset the divider, and confirm the sidebar is 360px wide. Change the
setting and confirm the width updates immediately. Drag it wider,
restart, and confirm the dragged width is kept. Double-click the divider
and confirm it returns to the configured width. Set the value to `5000`
and confirm the untouched sidebar clamps to 800px.

## 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 adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Added `agent.threads_sidebar_default_width` for setting the width of
the Threads Sidebar.
2026-09-15 14:53:12 +00:00
Dom Porada 5151c7953d Clarify how agent.flexible affects agent.default_width (#63020)
## Objective

`agent.default_width` is described as the Agent Panel’s default width,
but panels docked to the left or right use proportional sizing while
`agent.flexible` is enabled. Because flexible sizing is enabled by
default, double-clicking the outer resize handle restores the default
proportion rather than the configured pixel width. This can make
`agent.default_width` appear to be ignored.

## Solution

Clarify that `agent.default_width` controls the fixed width used when
`agent.flexible` is disabled, while resetting a flexibly sized Agent
Panel restores its default proportion.

Update the default settings comments, settings documentation, Settings
UI description, and visual customization guide. Add `agent.flexible` to
the Agent Panel configuration example and explain how it affects reset
behavior. No sizing behavior changes.

## Testing

- `cargo fmt --all -- --check`
- No runtime testing—the change only updates settings descriptions and
documentation.

## 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 adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-09-15 12:45:15 +00:00
Kirill Bulatov 45ff33717b Refine recent commands' UX (#64181)
Follow-up to https://github.com/zed-industries/zed/pull/63388 


https://github.com/user-attachments/assets/2a855451-141b-4030-8475-92f23c661d51

Release Notes:

- Improved recent commands' UX
2026-09-15 09:58:45 +00:00
Xiaobo Liu 450775244f gpui: Prevent idle sleep during AI response streaming (#53130)
Release Notes:

- Added button tu prevent idle sleep during AI response streaming


**Context / Motivation:**
When an AI agent takes a long time to generate a response, the operating
system might enter an idle sleep (or display sleep) state if there is no
user interaction (mouse or keyboard). This can interrupt the workflow.
This PR aims to prevent the system from sleeping during an active AI
turn by invoking native OS APIs, and provides a UI toggle for users to
control this behavior.

**Key Changes:**

1. **Cross-Platform Idle Sleep Prevention in GPUI (`gpui`, `gpui_*`)**
- Added a new `prevent_idle_sleep` method to the `Platform` trait. It
returns a RAII-based `PreventIdleSleepToken`, which automatically
restores the original sleep policy when dropped.
- **macOS**: Utilizes `NSProcessInfo`'s `beginActivityWithOptions` with
`NSActivityIdleDisplaySleepDisabled`.
- **Windows**: Uses `SetThreadExecutionState` to prevent display and
system sleep, incorporating a reference counter to handle concurrent
requests safely.
- **Linux**: Uses `ashpd` to request `org.freedesktop.portal.Inhibit`
(inhibiting `Idle` and `Suspend` states) via D-Bus.

2. **AI Agent State Integration (`crates/acp_thread`)**
- Introduced idle sleep prevention logic in `AcpThread`: Acquires the
token at the beginning of `run_turn`, and automatically releases it when
the turn completes normally, errors out, or is explicitly canceled by
the user.
- Added comprehensive unit tests to ensure the token is correctly
acquired and released under various cancellation and concurrency
scenarios.

3. **Settings and UI (`crates/agent_settings`, `crates/agent_ui`)**
   - Added `AgentOutputIdleSleepControl` to global state.
- Added a new toggle button (screen icon) to the toolbar at the bottom
of the `ThreadView` (AI conversation panel). Users can hover to view the
tooltip and click to toggle the feature on or off.

<img width="419" height="132" alt="截屏2026-04-04 16 09 08"
src="https://github.com/user-attachments/assets/619da9ff-10f7-46e0-b959-d7c74b16b918"
/>

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-09 13:49:13 +00:00
Chara 1d25e83fe8 project_panel: Honor preview setting for keyboard opens (#63758)
Closes #63725

Honor `preview_tabs.enable_preview_from_project_panel` when opening
files with `project_panel::Open` (Space), matching the setting-aware
single-click behavior. Add a regression test covering previews disabled.

Testing:

- `cargo test -p project_panel --lib`
- `cargo build -p zed`
- Manually verified with the setting disabled that Space opens two
permanent tabs
- Manually verified with the setting enabled that Space replaces the
previous preview tab
- `./script/clippy -p project_panel --tests` is blocked by an unrelated
existing `clippy::drain_collect` diagnostic in
`crates/rpc/src/proto_client.rs`

Manual verification:

Preview disabled — Space opens both files as permanent tabs:

<img width="1920" height="1032" alt="Preview disabled: Space opens both
files as permanent tabs"
src="https://github.com/user-attachments/assets/4b772aad-031e-401d-ac85-5a7f82a74bc1"
/>

Preview enabled — Space replaces the previous preview tab:

<img width="1920" height="1032" alt="Preview enabled: Space replaces the
previous preview tab"
src="https://github.com/user-attachments/assets/cfef36af-0cd5-4522-99b5-99d3bb2c3f9d"
/>

Release Notes:

- Fixed the project panel preview-tab setting being ignored when opening
files with the keyboard.

---------

Co-authored-by: Chara <249489759+cmdr-chara@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-09-07 12:13:53 +00:00
Jake Nelson ba6b83f89d workspace: Add configurable window title formatting (#54379)
## Summary
- Add `window_title_format` and `window_title_separator` settings for
customizing the window title
- Expose `${projectName}`, `${fileName}`, `${filePath}`,
`${relativePath}`, `${fileStem}`, `${remoteName}`, `${remoteHost}`,
`${appName}`, and `${separator}` as the native Zed window-title
variables
- Keep the collab `↗/↙` indicator hard-appended
- Translate VS Code `window.title` / `window.titleSeparator` aliases
into Zed's canonical variables during settings import, including
`${appName}` passthrough support and mapping VS Code's
`${activeEditorMedium}` onto Zed's `${relativePath}`
- Gate path-, remote-, and release-channel-derived lookups on whether
the active template references the corresponding variable, so the
default template avoids the extra work and still uses the existing
`last_window_title` cache to skip redundant platform updates

An alternative approach is at #49638. I went with `${variable}` names
over `$ZED_*`, canonical Zed variable names with VS Code aliases handled
at import time, kept `${separator}` as the only structural token, and
left `${dirty}` out of scope.

## Implementation reasoning and notes

### Variables considered but not included
- **collab/shared indicator variable**: kept hard-appended instead.
Folding it into the template would need whitespace/separator logic the
other variables don't need, and I'd rather not bake those semantics in
without a concrete need for it.
- **dirty variable**: The glyph choice and interaction with OS-level
edited indicators (like macOS's titlebar dot via `set_window_edited`)
felt like a separate design call I wasn't confident making here.

A separator-style config for each of collab/shared/dirty would solve the
above, but I didn't want to add too many additional settings initially.

### Performance
`update_window_title` is on a hot path, so two short-circuits apply:
- Path-, remote-, and release-channel-derived lookups (`absolute_path`,
relative-path string, `file_stem`, `remote_connection_options`,
`ReleaseChannel::try_global`) are gated on `template.contains(...)` via
`WindowTitleNeeds::from_template`, so the default template avoids the
extra work.
- The existing `last_window_title` cache still skips the platform call
when the rendered title is unchanged.

## Screenshots

Settings Editor entries for `window_title_format` and
`window_title_separator`:
<img width="774" height="324" alt="Settings Editor screenshot"
src="https://github.com/user-attachments/assets/b3378ec7-5649-4de3-9de6-164a42bce3fd"
/>

Customized Zed window titles in AltTab app switcher (remote, local,
empty):
<img width="774" height="324" alt="AltTab app switcher screenshot"
src="https://github.com/user-attachments/assets/a189945e-fc68-41b9-aab9-6dc04d5ef4ab"
/>

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

Closes #14534

Release Notes:

- Added configurable window title formatting with `window_title_format`
/ `window_title_separator`, including `${appName}` / `${remoteName}` /
`${remoteHost}` variables and VS Code `window.title` import support

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-04 13:48:58 +00:00
Manoj sk 9c3e2a071f project_panel: Show path tooltip on hover (#63299)
# Objective

The project panel doesn't show a file or folder's actual location on
disk anywhere in the UI — you have to rely on the tab title or context
menu ("Copy Path") to find out where a file actually lives, which is
especially unclear for files with the same name in different folders, or
when a project has multiple worktrees.

## Solution
- Adds a tooltip to each file/folder row in the project panel that shows
the entry's path on hover, with the home directory abbreviated to `~`
(via the existing `PathExt::compact()` utility, consistent with how
paths are already displayed elsewhere, e.g. the Recent Projects list).

## Testing

- Manually tested by hovering over files and folders at various nesting
depths in the project panel and confirming the tooltip shows the correct
path.
- Tested with a project both inside and outside the home directory to
confirm the `~` substitution only applies when appropriate.
- Confirmed existing row behavior (selection, click-to-open,
drag-and-drop, right-click context menu) is unaffected by the added
tooltip.
- Reviewers: hover over any row in the project panel and confirm the
tooltip appears after the normal hover delay and shows the expected
path.
- Tested on macOS only — haven't verified on Linux/Windows.

## Self-Review Checklist:

- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

## Showcase

<img width="1512" height="871" alt="image"
src="https://github.com/user-attachments/assets/ec86f9ab-0a8e-40f7-b783-8a115203f11d"
/>


- Help others understand the result of this PR by showcasing your
awesome work!
- If this PR includes a visual change, consider adding a screenshot,
GIF, or video
- A before/after comparison is very useful for changes to existing
features!

While a showcase should aim to be brief and digestible, you can use a
toggleable section to save space on longer showcases:

<details>
  <summary>Click to view showcase</summary>

My super cool demos here

</details>

---

Release Notes:

- Added a tooltip showing the file path when hovering over files and
folders in the project panel.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-09-04 11:05:53 +00:00
Josh Kent c1eda3e88a markdown_preview: Group settings and add automatic preview opening (#63462)
## Objective

Markdown preview appearance settings are split between root theme
settings and
`markdown_preview`, and Markdown files always open as source editors
even when a user primarily
wants the rendered preview.

## Solution

- Group the Markdown preview font settings under `markdown_preview`,
migrate their legacy keys
across supported settings scopes, and update defaults, Settings UI, and
documentation.
- Add `markdown_preview.open_markdown_files_in_preview`, defaulting to
false. When enabled, clean
Markdown opens are replaced by a rendered preview while preserving dirty
editors, temporary-tab
behavior, pane activation and focus, targeted navigation, workspace
restoration, and the escape
  back to source.

## Testing

- Manually verified on macOS that enabling the setting opens Markdown
files as preview-only.
- `cargo test -p markdown_preview` (three consecutive runs)
- `cargo test -p migrator nest_markdown_preview`
- `cargo test -p settings_content`
- `cargo check -p markdown -p markdown_preview -p migrator -p settings
-p settings_content -p settings_ui -p theme_settings -p workspace`
- `./script/clippy -p gpui_apple -p markdown -p markdown_preview -p
migrator -p settings -p settings_content -p settings_ui -p
theme_settings -p workspace --features gpui_apple/runtime_shaders`
- `cargo fmt --all -- --check`
- `git diff --check`

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Recordings


https://github.com/user-attachments/assets/032ab36d-f934-4ef7-aa18-53f3955a7df8


https://github.com/user-attachments/assets/dc872265-2fe0-45ac-95eb-ff820d3a8164

Release Notes:

- Added a setting to open Markdown files directly in preview mode and
grouped Markdown preview settings together.
2026-09-04 10:54:29 +00:00
Cain 2988a59241 editor: Add optional cursor movement animation (#63195)
# Objective

Add an optional smooth cursor movement animation to make cursor position
changes easier to follow, especially during larger jumps and
multi-cursor editing.

Related to #4991.

## Solution

- Add a new `cursor_animation.enabled` editor setting, disabled by
default.
- Animate local bar and block cursors using a damped spring while
preserving momentum during rapid cursor movement.
- Support multiple local cursors independently.
- Continue using the cursor color provided by the active theme.
- Snap immediately when scrolling, resizing, or other viewport changes
would make interpolation misleading.
- Respect the `reduce_motion` setting.
- Request animation frames only while an enabled cursor animation is
active.

Enabling the feature causes additional editor redraws while the cursor
is moving, so it is opt-in and the performance cost is mentioned in the
setting documentation.

### Attribution

The cursor spring physics and four-corner deformation algorithm are
adapted from
[vscode-neovide-cursor](https://github.com/LengineerC/vscode-neovide-cursor),
which is available under the MIT License and inspired by Neovide.

The implementation adapts the algorithm to Zed's editor and GPUI
architecture, including viewport handling, selection state
reconciliation, multi-cursor support, theme integration, and
reduced-motion behavior. The attribution and license information are
also retained in the source file.

## Testing

Automated checks run on Windows:

- `cargo fmt --all --check`
- `cargo test -p editor cursor_animation --lib`
  - 15 cursor animation tests passed.

The tests cover:

- Spring convergence.
- Short and long cursor movements.
- Mid-animation retargeting and momentum preservation.
- Multiple independent cursors.
- Selection replacement and state cleanup.
- Viewport and scroll changes.
- Invalid or unusually large timing values.
- Supported cursor shapes.

To test manually:

1. Add the following to the settings file:

   ```json
   "cursor_animation": {
     "enabled": true
   }
   ```

2. Move the cursor using typing, arrow keys, mouse clicks, and
multi-cursor actions.
3. Toggle the setting off and confirm that cursor rendering immediately
returns to its normal behavior.

Manual testing was performed on Windows and Linux using a release build
from this exact PR branch.

Verified that:

- Cursor animation is disabled by default.
- Enabling `cursor_animation.enabled` is hot-reloaded without restarting
Zed.
- Disabling the setting immediately restores the original cursor
behavior.
- Cursor movement remains responsive during typing, keyboard navigation,
and mouse navigation.

This exact PR branch has not yet been manually tested on macOS.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase


https://github.com/user-attachments/assets/17450529-491e-4982-b539-c46e3d5df467

---

Release Notes:

- Added an optional cursor movement animation setting.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-09-04 07:36:22 +00:00
Smit Barmase d85eade7ab which_key: Add a pending key binding indicator (#63343)
This PR makes Zed's one-second key binding delay visible.

Say both ctrl-w and ctrl-w left have bindings. After you press ctrl-w,
Zed waits to see whether left follows. The PR shows that wait in the
status bar with a countdown. Hovering the indicator shows which bindings
can still match.

It also adds a setting to hide the indicator. It does not change how Zed
resolves key bindings.

<img height="100" alt="dyn-db84a840272e2f6250a3f527a59b1efd"
src="https://github.com/user-attachments/assets/e42c6a6c-4677-499f-a1d3-835960ebb21a"
/>
<br/>
<img height="100" alt="dyn-8012278d030b41bc8ebfae1540504eff"
src="https://github.com/user-attachments/assets/250928d5-f913-40f0-9068-00ccb5cdf59f"
/>
<br/>
<img height="100" alt="file-5e6ffa90944faa294e7870f471b4e65b"
src="https://github.com/user-attachments/assets/c250e6eb-a269-4e2c-a5a0-0be9b5006f99"
/>

Release Notes:

- Added a status bar countdown for pending multi-stroke key bindings.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-03 09:35:53 +00:00
Albert Bogusz 810c6a04a6 Add on_new_window setting (#63522)
> [!NOTE]
> This is a remake of #63335 as it's unlikely to be reopened just from
my
[mention](https://github.com/zed-industries/zed/pull/63335#issuecomment-5452544138).
Apologies for the noise!

# Objective

Closes #59368, where users (including me) are asking for a way to show
the Launchpad instead of an empty tab when opening a new window. As per
advice from
https://github.com/zed-industries/zed/issues/60720#issuecomment-4936162420,
adding a separate setting from `restore_on_startup` is more ideal.

`on_new_window` allows for two values:
- `empty_tab`
- `launchpad` (default)

## Testing

Added a regression test which opens a new window with `on_new_window`
set to `launchpad` and asserts that no item gets opened in the window's
pane. I've verified it fails without the setting gate, and confirmed
configuring this setting works manually (see Showcase).

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase


https://github.com/user-attachments/assets/bf339bd1-8c62-4243-ac9d-1045d1a14865

---

Release Notes:

- Added `on_new_window` setting to configure the opening of new windows.
2026-09-02 18:17:30 +00:00
Matei Oprea 8ce383f221 Improve visibility and wording around close panel on toggle setting (#63548)
# Objective

- Improve documentation for `close_panel_on_toggle` setting. 

## Solution

- Previous docs were a bit ambiguous and since refactoring the setting
name is not possible at the time, I improved the documentation.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Release Notes:

- Added the`close_panel_on_toggle` setting to the settings UI and
improved its documentation.
2026-09-01 15:53:33 +00:00
František Gažo e8fbacb6d7 outline_panel: Add setting to hide symbols in multi-buffer views (#63404)
Closes https://github.com/zed-industries/zed/issues/60242

# Objective

When reviewing a branch diff — or project search results — the outline
panel lists every affected excerpt and symbol beneath each file. On a
diff touching more than a handful of files, this consumes so much
vertical space that you cannot see the list of changed files at all,
which is usually the thing you want the panel for.

Existing settings don't cover this:

- `expand_outlines_with_depth: 0` still renders excerpt rows and
top-level symbol rows.
- Collapsing a file row in the panel is coupled to folding that buffer
in the editor, so it can't be used purely to tidy the panel.

## Solution

A display-only mode that reduces multi-buffer views to just the
directory/file tree.

- New `outline_panel.multi_buffer_hide_symbols` setting (default
`false`). When enabled, multi-buffer views render only directory, file
and folded-directory rows — excerpt, symbol and search-match rows are
hidden.
- New `outline panel: toggle symbols` action, plus a button in the panel
footer, which toggles an in-memory per-panel override of the setting
(the same pattern as `editor: toggle inlay hints`). Changing the setting
clears the override, so the setting wins.
- Single-file views are exempt, and the footer button is not shown there
— the panel contains only symbols in that case, so hiding them would
leave it empty.
- The filter is display-only: `collapsed_entries` and editor buffer
folding are never touched.
- Outline fetching is skipped while the mode is active, so large diffs
don't pay for outlines that will not be rendered. Turning the mode off
re-triggers fetching.

This adds one new icon, `file_code_off`, used by the footer button when
symbols are hidden. cc @zed-industries/design for review per the icon
guidelines — it is `file_code` with the slash and outline gaps from
`file_ignored`, keeping the parts of the chevrons that fall on the near
side of the slash.

## Testing

Three new tests in `crates/outline_panel/src/outline_panel.rs`:

- `test_hide_symbols_in_multibuffer` — outline rows are present by
default; only `Fs`/`FoldedDirs` entries remain once the mode is enabled
via the setting (which also exercises the settings observer) and via the
action; outline rows return when it is toggled off, confirming outlines
are re-fetched; asserts `collapsed_entries` is unchanged at every step,
covering the display-only guarantee.
- `test_hide_symbols_exempts_singleton` — a single-file view still
renders its outline with the setting enabled.
- `test_hide_symbols_hides_search_matches` — project search match rows
are hidden while files and directories still render, and return when
toggled off.

`cargo test -p outline_panel` (15 passing), `cargo test -p icons`,
`cargo test -p settings_ui -p settings_content`, and `./script/clippy`
on the touched crates are all green.

Tested manually on macOS against a branch diff, project search results,
and single-file buffers, checking both the setting and the action (from
the panel footer button and from the command palette with focus outside
the panel), and that expanding/collapsing directories and editor folding
still behave as before.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<!-- Screenshots go here: branch-diff before/after, footer button icon
states, search before/after, single-file exemption -->


|  | Symbols shown (default) | Symbols hidden |
| --- | --- | --- |
| **Footer toggle** | <img
src="https://github.com/user-attachments/assets/393f128d-1a7c-43a8-97b8-8176a07b45c7"
width="260"> | <img
src="https://github.com/user-attachments/assets/87c60dd4-d5b7-48f8-9255-226c4a94a586"
width="260"> |
| **Branch diff** | <img
src="https://github.com/user-attachments/assets/79357325-7d7d-40f7-8067-4ae59a824f87"
width="420"> | <img
src="https://github.com/user-attachments/assets/8a3bbc7e-90d4-4638-9f1d-1ba3091eccfd"
width="420"> |
| **Project search** | <img
src="https://github.com/user-attachments/assets/76e3cf18-d624-42f8-8801-f496bf54a552"
width="420"> | <img
src="https://github.com/user-attachments/assets/2a34e899-b9f4-465e-b571-75d3d54d00eb"
width="420"> |

Single-file views are unaffected — symbols still render, and the toggle
is not offered:

<img
src="https://github.com/user-attachments/assets/76c47884-96db-4071-bcc1-931c4283e36f"
width="640">

---

Release Notes:

- Fixed too many outlines shown per excerpt in the outline panel. Added
an `outline_panel.multi_buffer_hide_symbols` setting and an `outline
panel: toggle symbols` action to show only files and directories in the
outline panel for multi-buffer views.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-08-31 14:36:04 +00:00
ᴀᴍᴛᴏᴀᴇʀ 669bede5c5 editor: Add language detection for untitled buffers (#61412)
# Objective

Closes #4868.

Reintroduce automatic language detection for user-created untitled
buffers without allowing it to override language choices made by users
or owning surfaces.

More details:
+ https://github.com/zed-industries/zed/pull/61201
+ https://github.com/zed-industries/zed/pull/61351

## Solution

VS Code distinguishes between inferred and explicitly selected
languages, and only continues automatic detection in the former state.
This change introduces a buffer-local opt-in flag with the same purpose.
It defaults to disabled and is enabled only for user-created untitled
buffers and restored untitled buffers that did not persist a language.
Choosing a language through the language picker disables detection,
while automatically detected languages remain eligible for later
redetection. Buffers whose language is assigned by their owning surface,
such as Channel Notes, never opt in.

Rather than adding persisted state or changing the database schema,
restoration reuses the existing optional serialized language. An
opted-in buffer that remains Plain Text is serialized without a language
and resumes detection after restoration. Once automatic detection has
selected a language, that language is serialized normally and
restoration leaves detection disabled, effectively treating it as an
explicit selection. This also matches VS Code's effective default after
restoration.

Candidate selection adopts VS Code's confidence-group filtering. Results
below the minimum confidence are discarded, and candidate groups are
accepted only after a clear confidence gap. The detector then selects
the first available Zed language without eagerly loading every
candidate. I then added a separate switching rule: Zed keeps the current
language unless another candidate has a clear confidence advantage,
reducing language changes as model scores fluctuate during editing.
Model inference runs off-thread on a bounded sample, and stale results
are discarded.

I also evaluated penalizing YAML and using stricter global switching
thresholds, but neither reliably resolves the ambiguity between Markdown
and YAML. In the reproduction from #61351, Betlang assigns YAML more
than 80% confidence during editing and peaks around 90%. This is
reasonable from the content alone: `#` denotes a YAML comment, while `-`
denotes a sequence item. Adding ordinary prose or a fenced code block
shifts the model strongly toward Markdown. A fixed penalty would overfit
this example and risk suppressing legitimate YAML detection. Since
known-language buffers do not opt in and manual language selection takes
precedence, I consider this level of ambiguity acceptable and prefer not
to introduce language-specific score tuning.

Model inference itself is fast. As noted in #61201:

> In release builds on Linux with an Intel Core i5-13600KF, the
`betlang::detect` call alone typically completes within 3 ms when
processing the maximum sampled input.

The main concern is the work surrounding inference. Without debouncing,
rapid typing creates a snapshot and launches a background detection task
on every keystroke, while the detected language may change before the
user has finished typing. This change therefore adds a 200 ms debounce
delay, allowing detection to run and update the language only after the
user pauses.

## Testing

Automated coverage verifies that short inputs remain Plain Text,
sufficient Rust content is detected as Rust, replacing it with Go
content triggers redetection, and manually selecting Plain Text prevents
subsequent automatic changes. Restoration coverage verifies that a
stored language keeps detection disabled, while an empty language-less
untitled buffer resumes detection.

Beyond the automated tests, I manually tested automatic language
detection while editing untitled buffers.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase


https://github.com/user-attachments/assets/103fc731-e12e-48d6-ae89-03978f1c9d74




---

Release Notes:

- Added automatic language detection for untitled buffers.

---------

Co-authored-by: Max Stevens <maxstevens2708@gmail.com>
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-08-28 13:19:29 +00:00
Sean Wood 351899e531 feat: Add reveal buffer if already open (#63306)
# Objective

Fixes #12572

## Solution

- Adds an opt-in `reveal_if_open` setting which enables searching and
revealing an already open buffer
- Ensures this only happens if there is no pane target for the open
intent

## Testing

- Built for and tested on my Mac
- Tests added covering the scope of the feature

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase


https://github.com/user-attachments/assets/cdcc78cd-85fd-4b56-b562-feba375ecd03

---

Release Notes:

- Added configuration to reveal buffers already open in a different pane
instead of the active pane, via `reveal_if_open`

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-08-28 11:51:00 +00:00
Dong 8166e3d7b8 Add folder_indicator setting to show chevron and folder icon together (#62393)
# Objective

- Enable panels to show chevron and icon at the same time.
- Closes #8661

## Solution

- Replaces `folder_icon` with a new `folder_indicator` which converts
from a boolean to enum (`both`, `chevron`, `icon`) for the three display
cases

## Testing

- gpui and migration tests had been applied

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

### project panel

both | chevron | icon
--- | --- | ---
<img width="400" alt="both_project_panel"
src="https://github.com/user-attachments/assets/4c21e1a1-a7a4-4471-b7de-fe867373ddbd"
/> | <img width="400" alt="chevron_project_panel"
src="https://github.com/user-attachments/assets/a626a82e-e5b7-470d-9d93-ed5787dc83d6"
/> | <img width="400" alt="icon_project_panel"
src="https://github.com/user-attachments/assets/20f9c55e-87c4-477a-b4c9-b070d6e5a1db"
/>

### git panel

both | chevron | icon
--- | --- | ---
<img width="400" alt="both_git_panel"
src="https://github.com/user-attachments/assets/3dc166dd-9e63-4943-b803-df3f167876b6"
/> | <img width="400" alt="chevron_git_panel"
src="https://github.com/user-attachments/assets/8dfd2c10-3a68-439a-8019-4951b72e17d1"
/> | <img width="400" alt="icon_git_panel"
src="https://github.com/user-attachments/assets/d78a9938-91e7-4d39-a3c8-04647da67768"
/>

### outline panel

both | chevron | icon
--- | --- | ---
<img width="400" alt="both_outline_panel"
src="https://github.com/user-attachments/assets/1b58c679-0bea-4600-a8ac-e800b0e8d24c"
/> | <img width="400" alt="chevron_outline_panel"
src="https://github.com/user-attachments/assets/0a9358e4-ec89-40d8-8d5e-a53b784ed30a"
/> | <img width="400" alt="icon_outline_panel"
src="https://github.com/user-attachments/assets/d8bf5199-5a8c-4de0-b516-00247e6531a5"
/>



---

Release Notes:

- Added a `folder_indicator` setting that can show the disclosure
chevron and folder icon at the same time in the project, outline, and
git panels.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-08-27 20:11:28 +00:00
Tristam MacDonald ec312b2701 Add LSP call hierarchy modal (#53239)
<img width="1128" height="953" alt="image"
src="https://github.com/user-attachments/assets/b2017c0a-e25a-49d7-9342-d074014d085c"
/>

Closes #14203

Release Notes:
- Initial Call Hierarchy support in Zed

---------

Co-authored-by: Alexey Olshanskiy <gh@aohoy.dev>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-08-27 16:21:41 +00:00