Commit graph

37876 commits

Author SHA1 Message Date
João Soares
7d7ec655e7
terminal_view: Show hollow cursor when bar/underline is unfocused (#53713)
Self-Review Checklist:**

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

## What

When terminal cursor shape is set via escape sequences (e.g. `\e[6 q`
for bar, `\e[4 q` for underline), the cursor looks identical whether the
terminal is focused or unfocused. Block cursors already convert to a
hollow outline when unfocused, but bar and underline were missing this
treatment.

## How

Added unfocused guards for `Beam` and `Underline` in the cursor shape
match in `terminal_element.rs`, converting them to `Hollow` when the
terminal loses focus. This follows the same pattern already used for
`Block`.

## Why this approach

A hollow block outline is the clearest unfocused signal and stays
consistent with the existing Block behavior. Alternative approaches like
dimming opacity or drawing outlined versions of bar/underline were
considered, but a 2px-wide outlined bar would be nearly invisible at
normal font sizes.

## Demo:
Before: 


https://github.com/user-attachments/assets/81d49899-0837-42fe-a68f-4eb745892af6

After:


https://github.com/user-attachments/assets/a4444e28-5835-4c9f-872f-e9ce8c4805a0


Closes #52716

Release Notes:

- Fixed terminal bar and underline cursors set via escape sequences not
visually distinguishing between focused and unfocused states
2026-04-21 03:11:46 +00:00
Tim Vermeulen
e4d0c89c9f
cli: Make zed --wait --diff not wait until window close (#54367)
`zed --wait --diff <left> <right>` currently waits for the entire window
to close instead of just the diff itself, due to the combination of
- `zed --diff` adds the cwd to the paths to open (see #45131), and
- passing a directory to `zed --wait` blocks until the Zed window is
closed (see #44936), which doesn't distinguish between explicit paths
and the one `zed --diff` adds

Fixed by only running the `zed --wait <dir>` logic to block until the
window is closed in case the user actually passed any non-diff paths.

I've confirmed locally that it works, though I wasn't really sure how to
write a good test for this.

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

Release Notes:

- `zed --wait --diff <left> <right>` now blocks until the diff is
closed, and not until the entire window is closed.
2026-04-20 18:03:26 -07:00
Danilo Leal
d84a00c017
sidebar: Improve hover in history view thread items (#54370)
This PR improves the hover state in thread items within the history view
by making them more stable. There were other thread events calling a
refresh, which would clear the hover state even though I'd still be
hovering the item, making the buttons that only appear on hover feel
unstable and disappear.

Release Notes:

- Agent: Improve hover state stability on thread items within the
sidebar's history view.
2026-04-20 21:19:50 -03:00
Danilo Leal
d7eeb5cca9
sidebar: Adjust display of workspaces in header's ellipsis menu (#54360)
This PR only displays the X icon button to close an workspace when the
number of available ones is bigger than one, and does some light UI
tweaks to how we display the project labels inside the menu item.

Release Notes:

- N/A
2026-04-20 20:31:42 -03:00
Max Brunsfeld
aa5293de22
Avoid constantly scrolling thread history to top as agent generates (#54365)
Fixes two problems:

* We were not preserving scroll position in the thread history view when
the thread metadata store updated
* We were updating thread metadata on every single chunk streamed by the
agent, even though the content of the thread does not affect its
metadata.

Release Notes:

- N/A
2026-04-20 16:15:01 -07:00
Emamul Andalib
f2cead49b1
languages: Fix nested object methods missing from outline panel (#50754)
Shorthand methods (`methodName() {}`) inside nested object literals were
not shown in the Outline panel. The outline query only captured
method_definition when it was a direct child of a variable_declarator's
object, so nested objects (e.g. `deep: { subFn() {} }`) were missed.

Extended the outline query to match method_definition in any object
node, not just top-level variable_declarator objects. Applied the fix to
TypeScript, JavaScript, and TSX outline definitions. Added tests for the
issue reproduction and edge cases.

Supporting evidence:
<img width="1352" height="812" alt="image"
src="https://github.com/user-attachments/assets/64868a70-abd3-4935-9c03-4c809b55262b"
/>

Fixes #48711

Release Notes:

- Fixed nested object methods not appearing in the Outline panel for
JavaScript and TypeScript files
2026-04-21 00:36:39 +02:00
Cole Miller
b8bec905de
git: Fix a panic when updating the split diff (#54352)
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed a panic when using the split diff view.
2026-04-20 18:33:42 -04:00
Nadir
a8b84497a3
repl: Correctly discover user's kernels (#50978)
Closes #50977

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Before:
<img width="1700" height="1063" alt="image"
src="https://github.com/user-attachments/assets/fd8e8438-a8a8-4d00-ac72-7e5ab75c8723"
/>

After:
<img width="1700" height="1066" alt="image"
src="https://github.com/user-attachments/assets/e31e449d-93ce-433e-94fd-cfdc08d61f49"
/>


Release Notes:

- Fixed kernels discovery in python notebook editor.

---------

Co-authored-by: Finn Evers <finn@zed.dev>
2026-04-20 22:11:11 +00:00
Anthony Eid
4b48819072
agent: When opening a remote thread check that the linked worktree path exists (#54353)
If the path doesn't exist we fallback to the main worktree path. This
handles the edge case where a git linked worktree is deleted on a remote
machine, and a user tries to open a thread based on that.

We fallback to the main git worktree in this case, if that doesn't exist
the project will open in an error state (empty workspace) like we
already do

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 #ISSUE

Release Notes:

- N/A
2026-04-20 17:18:09 -04:00
Ivan Mironov
66a77d29fd
Fix devcontainer localEnv/containerEnv substitution when variable is undefined (#53728)
Existing code replaces only the variables that are present in the
environment. It ignores references to undefined variables and leaves
them as is.

Consider following devcontainer.json:

```json
{
  ...
  "remoteEnv": {
    "RUSTFLAGS": "${localEnv:RUSTFLAGS}"
  },
  ...
}
```

Existing code will set RUSTFLAGS inside the dev container to a correct
value only if RUSTFLAGS is defined outside the dev container. If
RUSTFLAGS is not defined outside, Zed will erroneously set RUSTFLAGS to
`${localEnv:RUSTFLAGS}`.

This patch fixes this by replacing such references with either empty
strings or provided default values (`${localEnv:VARNAME:default}`).

This patch also removes replacement of `\` with `/` for environment
variables. Existing code makes no sense as simple replacement will not
magically make Windows paths valid on *nix. It is also guaranteed to
break things: think about passing passwords via env vars, for example.

I also noticed that, for some reason, existing code serializes k-v maps
to JSON, then tries to replace the references, and after that
deserializes modified JSON back. I believe that this is horribly wrong
and may have some security implications. This is out of the scope of
this patch. And I hope that somebody from the Zed team will provide the
reasoning behind this code.

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 #ISSUE~~ This pull request is also a bug report.

Release Notes:

- Fixed substitution of `${localEnv:VARNAME}` and
`${containerEnv:VARNAME}` in devcontainer.json when variable is not
defined
2026-04-20 16:12:17 -04:00
Finn Eitreim
e18da9ef6d
vim: Prevent flickering during movement actions (#52270)
## Context

Closes #52202

Some actions we're unnecessarily delayed during execution by a
yield_now().await call, causing flickering while moving around.

Video Before:


https://github.com/user-attachments/assets/f9922915-8bc7-4e9e-8ce9-18a1e898b69e

Video After:


https://github.com/user-attachments/assets/a46a6338-3fef-4784-8fd7-ecec07a28cf6



## How to Review

when we call the yield in workspace.rs

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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:

- vim: fixed screen flickering during motions.

Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
2026-04-20 19:57:19 +01:00
Max Brunsfeld
4919ca43ec
Always use ArchiveSelectedThread action for archiving threads (#54348)
This changes the action for archiving threads in the main sidebar view
from `RemoveSelectedThread` to `ArchiveSelectedThread`. It has the same
key binding as before: `shift-backspace`. I also added `ctrl-backspace`
as a binding for deleting archived threads in the history view.

Release Notes:

- N/A
2026-04-20 18:47:40 +00:00
galuis116
f37df7b78d
recent_projects: Fix unaligned keybinding labels in quick-switch menu (#54325)
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 #54324 

Release Notes:

- Fixed shortcut label alignment in the Recent Projects quick-switch
footer by rendering action rows with a consistent two-column layout
(label left, keybinding right) for “Add Local Folders” and “Add Remote
Folder”.

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-04-20 15:29:58 -03:00
Finn Evers
261c07358e
ci: Fix target branch for Zippy version bumps (#54346)
I assumed the action would pick up the branch from the context - turns
out it did not.

Release Notes:

- N/A
2026-04-20 18:25:44 +00:00
Tom Houlé
57e01b3701
language_models: Fix misleading copy when hosted models are disabled (#53971)
The agent settings UI unconditionally showed "You have access to Zed's
hosted models through your Organization" for all Business plan users,
even when the org admin had turned off the Zed AI model provider. Now
the copy reads "Zed's hosted models are disabled by your organization's
configuration" when is_zed_model_provider_enabled is false.

Also added component preview entries for both Business plan states.

Closes CLO-667

Release Notes:

- N/A

---------

Co-authored-by: Neel <neel@zed.dev>
2026-04-20 19:57:45 +02:00
Eric Holk
c289ec71a2
worktree: Fix crash on rescan of an unregistered linked worktree commondir (#54215)
## Summary

Fixes a crash I hit running Zed Preview against a checkout with many
linked git worktrees. The panic was:

```
thread '<unnamed>' panicked at crates/worktree/src/worktree.rs:5334:25:
update_git_repositories: .git path outside worktree root is not a gitfile: "/Users/eric/repo/zed/.git"
```

The `debug_assert!` in `update_git_repositories` was added in #53443 to
catch the case where a `.git` path outside the worktree root is not a
gitfile. The comment there explained that a `.git` outside the root
should always be a gitfile (as in a linked worktree or submodule), so
the assertion was meant to flag "should never happen" paths.

But there's a second legitimate case: after a linked worktree's
repository has been unregistered from `git_repositories` (for example
because its gitfile was removed, or because the filesystem watcher for
the common git dir lost sync and rescan-driven cleanup dropped the
entry), a subsequent rescan event on the main repo's `.git` directory
arrives at the linked worktree's scanner with the common git dir as the
`dot_git_dir`. That path:

- is outside the linked worktree's root (so it doesn't strip-prefix
cleanly), and
- is a real directory (not a gitfile), because it's the main repo's
`.git`.

So the assertion fires, but `continue` is already the right thing to do
— there's simply nothing left for this scanner to do with a path that
isn't its repository anymore.

On macOS, the trigger in practice is the FSEvents API setting
`MustScanSubDirs` / `UserDropped` / `KernelDropped` on an event (which
`notify` surfaces as `need_rescan()`), which our `FsWatcher` converts
into a `PathEvent { path: <watched path>, kind: Rescan }`. Because every
linked worktree registers a watcher on the same shared common git dir,
one kernel drop fans out into many rescan callbacks, and any one of them
hitting a worktree whose repo was just unregistered triggers the panic.

## Changes

- `crates/worktree/src/worktree.rs` — drop the `debug_assert!`, broaden
the comment to cover both cases.
- `crates/worktree/tests/integration/main.rs` — add a failing regression
test that drives the exact sequence (repo unregistered, then a Rescan
event on the common git dir) and asserts it doesn't panic.

The two commits are split so the test commit reproduces the panic on its
own, and the fix commit on top makes it pass.

Release Notes:

- N/A
2026-04-20 13:56:16 -04:00
Oleksiy Syvokon
b748282f2d
ep: Add V0327SingleFile prompt (#54338)
Simplification of V0318 with:

- Simpler editable region selection strategy
- Large current file snippet
- No related files



Release Notes:

- N/A
2026-04-20 20:31:31 +03:00
Smit Barmase
68da244d37
agent: Respect favorite model settings and sync UI changes back to settings (#54318)
Closes #54313

**Before:**
- Favoriting a model only stored `provider`, `model`, and hardcoded
`enable_thinking` to `false`.
- Selecting a favorited model would not restore your preferred
`enable_thinking`, `effort`, or `speed` settings.

This means that if you'd like to use, say, GPT 5.4 your favorite model
on `xhigh` effort every single time, switching to it would set effort to
`medium` (the default for the model) instead.

**After:**
- Favoriting a model captures your current `enable_thinking`, `effort`,
and `speed` when it matches the currently-selected model. Otherwise, it
falls back to the model's own defaults, i.e. thinking-capable models are
no longer favorited with `enable_thinking` forced to `false`.
- Selecting a favorited model applies its stored thinking / effort /
speed.
- Toggling thinking, changing effort, or toggling fast mode on a
favorited model updates the favorite entry in settings (along with the
existing `default_model` setting), so the preference doesn't drift.

Release Notes:

- Agent favorite models now remember and restore per-model thinking,
effort level, and fast mode preferences.
2026-04-20 22:40:00 +05:30
Kunall Banerjee
cd12d5f98d
dev_container: Make all PortAttributes fields optional (#53799)
The Dev Container [metadata
reference](https://containers.dev/implementors/json_reference/#port-attributes)
defines all five `PortAttributes` fields (`elevateIfNeeded`, `label`,
`onAutoForward`, `protocol`, `requireLocalPort`) as optional with
defined defaults. The struct required all of them, causing
deserialization failures for any `portsAttributes` entry that omitted a
field.

Add `#[serde(default)]` to each field, wrap `label` and `protocol` in
`Option<T>` (spec default: not set), and derive `Default` on
`OnAutoForward` with `Notify` as the default variant (spec default:
`notify`). The bool fields already default to false via
`serde(default)`, matching the spec.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] 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
- [ ] Performance impact has been considered and is acceptable

Closes #53686.

Release Notes:

- Made all `PortAttributes` fields optional according to the Dev
Container spec
2026-04-20 10:05:12 -07:00
Finn Evers
98f94e2064
ci: Verify commits and releases created with Zed Zippy (#54264)
This changes our approach for creating Zed version bumps with the Zed
Zippy identity:

With these changes, the Zippy version bumps as well as the tag creations
will be verified as per
https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification#signature-verification-for-bots.
This adds an extra layer of security for version bumps and release
triggers done by the Zippy identity.

Eventually, we can move code more around for this so it happens in the
bot itself, but for now, I think its a good and solid interim solution
to have this here.

Release Notes:

- N/A
2026-04-20 18:54:12 +02:00
Cameron Mcloughlin
9ba6a32ec6
sidebar: Consistently set interacted_at (#54320)
There were a few places where you could trigger generation without
causing the `interacted_at` field to be set.

Also renames `message_sent_or_queued` to `interacted`, to be consistent
with the field on `ThreadMetadata`

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-04-20 17:34:23 +01:00
Bennet Bo Fenner
c28d82cbcb
feature_flags: Fix issue where staff is not automatically signed into collab (#54332)
Follow up to #54206

`on_flags_ready` relied on the fact that the `FeatureFlagStore` was only
set once the flags had been received from the server.
However, after #54206 the global gets instantiated earlier, without the
flags being resolved.

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:

- N/A
2026-04-20 18:09:43 +02:00
Smit Barmase
5a589c4b1d
markdown_preview: Fix outline panel becoming empty when preview pane is focused (#54301)
Closes #52663

Release Notes:

- Fixed outline panel becoming empty when switching focus to a Markdown
Preview pane.
2026-04-20 21:30:25 +05:30
Gonçalo Aleixo
e5086f306e
editor: Fix auto indent adding trailing whitespace on repeated enter (#52628)
Update how auto indentation is handled by `Editor::newline`, in the case
where auto-indentation is not `AutoIndentationMode::None`, so as to
extend the range of the edits being applied to the beginning of the
line, in case the line only contains the indentation whitespace or
there's only whitespace indentation before the cursor position

This ensures that newlines are not left with whitespace.

Closes #34316 

Release Notes:

- Fixed auto indent leaving trailing whitespace on blank indented lines
when creating new lines.⁠

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-04-20 16:51:36 +01:00
Lukas Wirth
0ba60d8a44
worktree: Fix .git modified events not being correctly filtered out (#54329)
Release Notes:

- N/A or Added/Fixed/Improved ...

Co-authored by: Cole Miller <cole@zed.dev>
2026-04-20 15:49:25 +00:00
KyleBarton
17026b10d6
Use dockerfile build args correctly, respect context path, fix image aliasing (#54210)
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 #54193

Additionally, respects `cacheFrom` and `options` args defined in
devcontainer.json's `build` object. Also, addresses a bug which was
hiding these problems by overriding the primary build target with
aliasing.

Release Notes:

- Fixed an image aliasing but, respect build context and build args in
dev containers
2026-04-20 08:38:53 -07:00
Lukas Wirth
634e91bdac
editor: Enable diagnostics underlines in split editors (#54295)
Release Notes:

- Enabled diagnostic underlining in the split editor views
2026-04-20 17:12:32 +02:00
Ben Kunkle
5301958287
ep: Don't throw away model version in reject events (#54159)
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 #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-04-20 10:35:02 -04:00
Ben Kunkle
db7bc734e2
Fix ep preview closing menus (#54194)
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 #52559

Release Notes:

- Fixed an issue where holding the modifiers used in
`editor::AcceptEditPrediction` would cause the code action menu to
dissapear
2026-04-20 10:20:34 -04:00
João Soares
1e0481854a
editor: Hide run button in gutter for unsaved buffers (#53195)
## 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 #52942


## Demo:
### Before:


https://github.com/user-attachments/assets/fd3b69fc-468a-4fd1-82c9-4f1aa83c6474




### After:


https://github.com/user-attachments/assets/0a6c70a9-0a4a-4657-9fe8-21988fff9e80



## Release Notes:

- Fixed play button appearing in gutter for unsaved buffers where
clicking it was a no-op.

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
2026-04-20 15:51:21 +02:00
Vinícius Dutra
4d78f26c27
Add support for Netpbm image previews (#54256)
This PR adds support for rendering **Netpbm** image formats (`.pbm`,
`.ppm`, `.pgm`) within Zed's built-in image viewer.

These formats are particularly useful for projects that want minimal
external dependencies, a common scenario in academic environments and
low-level graphics programming.

Since the underlying `image` crate and `GPUI` already provide support
for these codecs, this change explicitly exposes the `Pnm` variant
within `gpui::ImageFormat` by mapping it to `image::ImageFormat::Pnm`.

## Screenshots/Examples

Below is an example of `.pbm`, `.ppm`, and `.pgm` files being rendered
correctly in the image preview (images taken from
https://filesamples.com):
<img width="1917" height="1012" alt="pnm_example"
src="https://github.com/user-attachments/assets/0056133f-908c-4c91-ba9d-53aef0657b05"
/>



Release Notes:
  - Added support for PNM image previews (`.pbm`, `.ppm`, `.pgm`).
2026-04-20 16:51:13 +03:00
João Soares
b204582f7e
Add NewFile keybinding to Welcome context (#52463)
## Context

`ctrl-n` / `cmd-n` doesn't work on the Welcome tab. The global binding
lives under `Workspace && !Terminal` (macOS) and similar contexts that
don't include Welcome. The fix just adds the same binding to the Welcome
context block on all three platforms — same approach the font-size and
recent-project shortcuts already use there.

Closes #52426

## Demo

### Before:




https://github.com/user-attachments/assets/69becde8-25d2-45e3-9e7c-416b7937bd17

### After:




https://github.com/user-attachments/assets/6d9ede76-7adb-4527-bfef-c18d5b8a4fb4









## How to review

One line added per platform keymap file. Check that `ctrl-n` / `cmd-n`
maps to `workspace::NewFile` in the `Welcome` block of:
- `assets/keymaps/default-macos.json`
- `assets/keymaps/default-linux.json`
- `assets/keymaps/default-windows.json`

## 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 is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed `ctrl-n` / `cmd-n` (New File) not working on the Welcome tab

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-04-20 10:28:45 -03:00
galuis116
4854ad98db
Improve button keybinding alignment in workspace switcher (#54300)
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 #54299 

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-04-20 10:16:57 -03:00
galuis116
7ca737fcf1
git_graph: Fix pluralization of "Changed Files" in commit details (#54284)
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 #54283 

Release Notes:

- Fixed: Git graph commit detail header now uses “1 Changed File” when
exactly one file changed, and “N Changed Files” otherwise, instead of
always saying “Changed Files”.

---------

Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
2026-04-20 10:09:27 -03:00
galuis116
11b8980dc1
outline_panel: Fix inconsistent keybinding label casing (#54307)
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 #54305 
Release Notes:

- Fixed inconsistent keybinding hint casing in the outline panel
(“Toggle Panel With …”) by using standard keybinding rendering.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-04-20 10:05:54 -03:00
galuis116
3323581009
outline_panel: Fix Pin/Unpin tooltip does not update after state changes (#54310)
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 #54309 

Release Notes:

- Fixed an outline panel issue where the pin/unpin tooltip could show
stale text after toggling.
2026-04-20 12:56:23 +00:00
Pranav Nedungadi
a7ca17fcb2
edit_prediction_ui: Add configure providers menu item to Copilot and Codestral (#53691)
Codestral and copilot has a custom menu being built out. While the
common menu has the configure provider quick setting, the custom menu
doesn't have them. however it is a neat feature to have and quickly
switch it out.

Furthermore, copilot has an option of "Use zed AI" when copilot isn't
signed in. Instead add the complete list and configure provider when it
is not signed in

Before
<img width="256" height="588" alt="Screenshot 2026-04-11 at 4 46 47 PM"
src="https://github.com/user-attachments/assets/7de1c09c-a7a0-46d1-9572-fa5e970c77a8"
/>
<img width="230" height="480" alt="Screenshot 2026-04-11 at 4 47 00 PM"
src="https://github.com/user-attachments/assets/7075538f-1966-4ece-985f-b5e0d1d50f4a"
/>

After
<img width="259" height="663" alt="Screenshot 2026-04-11 at 5 02 48 PM"
src="https://github.com/user-attachments/assets/31094f7b-8efa-488a-87d8-1998e554ec74"
/>
<img width="242" height="580" alt="Screenshot 2026-04-11 at 5 03 21 PM"
src="https://github.com/user-attachments/assets/aba8ba09-1fbd-4c43-ba1f-af7ed51551a4"
/>
<img width="224" height="253" alt="Screenshot 2026-04-11 at 5 03 44 PM"
src="https://github.com/user-attachments/assets/108e7b6f-1216-4a2c-b0c0-7be3dc5438b0"
/>


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

Closes NA

Release Notes:

- added configure provider menu item to copilot and codestral

---------

Signed-off-by: Pranav <pranav10121@gmail.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-04-20 08:55:07 -04:00
Danilo Leal
10cf73f8cc
agent_ui: Add setting for turning off content max-width (#54316)
Follow up to https://github.com/zed-industries/zed/pull/52730. 

This PR adds a boolean setting `limit_content_width` in the Agent Panel
settings that allows turning off the content max-width entirely, which
was added for better readability. We had a handful of requests for it,
so it feels fair.

<img width="500" alt="Screenshot 2026-04-20 at 8  57@2x"
src="https://github.com/user-attachments/assets/d2540b35-3fa8-4424-895d-dc499ac4839c"
/>

Release Notes:

- Agent: Added a new `limit_content_width` setting in the agent panel
that allows turning off the content max-width limit.
2026-04-20 09:51:26 -03:00
Finn Eitreim
68541960a7
fuzzy_nucleo: Add strings module and route several pickers through it (#54123)
Stacked on top of #54112
This is part 2 of 3 towards #51197
More details from the original PR #53551

This PR includes the changes from #54112 , im not sure how to avoid
that, my understanding is that after that one is merged, this PR can be
rebased onto main and everything will be correct. You can also view the
version of this that does reflect the changes more directly here:
https://github.com/feitreim/zed/pull/1

## Changes

In this PR I added a more general string matching functionality to
`fuzzy_nucleo`, in order to have proper testing for this, I also changed
the command palette, tab switching picker, branch picker, and recent
projects picker to use this new implementation. I think the command
palette change in particular is awesome, just super nice to vaguely
gesture at the command i want and have it pop right up.

The main change here and departure from
https://github.com/zed-industries/zed/pull/37123 is realizing that the
primary reason for the regressions is actually how nucleo handles smart
case, the old `fuzzy` crate only uses the smart case argument to score
things differently, while nucleo actually filters on the case, eg. with
smart case query "Apple" wouldnt match "apple". To get around this we
always pass `CaseMatching::Ignore` to nucleo and implement the same
score modifications from fuzzy in our code.

There is a performance cost to that, of course, but from my testing it
is fairly static, not growing as the size increases, so maybe a query
takes 35 µs instead of 25 µs, but a query that takes 800 µs will only
take 820 µs.

Benchmark:
| kind | query | size | nucleo | fuzzy | nucleo/fuzzy |
  |---|---|---:|---:|---:|---:|
  | string | 1-word | 100 | 9.15 µs | 24.6 µs | 0.37× |
  | string | 1-word | 1000 | 150.2 µs | 207.2 µs | 0.72× |
  | string | 1-word | 10000 | 1.34 ms | 2.07 ms | 0.65× |
  | string | 2-word | 100 | 5.16 µs | 2.94 µs | 1.75× |
  | string | 2-word | 1000 | 29.0 µs | 11.0 µs | 2.63× |
  | string | 2-word | 10000 | 210.6 µs | 55.5 µs | 3.79× |
  | string | 4-word | 100 | 2.57 µs | 2.33 µs | 1.10× |
  | string | 4-word | 1000 | 6.98 µs | 5.85 µs | 1.19× |
  | string | 4-word | 10000 | 20.0 µs | 12.0 µs | 1.66× |

When I added the 4-word queries to the benchmarks I was actually really
concerned that the performance would be awful, making it unsuitable for
the command palette especially. However, I think due to the CharBag
pre-filtering when the query is longer, the performance is actually way
better than the 2 word case.

Video:


https://github.com/user-attachments/assets/3cd7221b-424f-4fd3-8df1-5543dcc340a3

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:

- Improved fuzzy matching in the command palette, branch picker, tab
switcher, and recent projects picker to support multi-word queries.

---------

Co-authored-by: Yara <git@yara.blue>
2026-04-20 14:41:29 +02:00
Abhishek Tripathi
1115f768c9
copilot: Wire up reasoning tokens for GPT models (#53313)
Fix two issues with reasoning support in the Copilot provider:

- Responses API path: use the user's thinking_effort setting instead of
hardcoding Medium effort
- Chat Completions path: compute and pass thinking_budget when thinking
is enabled, instead of unconditionally setting it to None

Self-Review Checklist:

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

Closes #52140

Release Notes:

- Fixed a bug where copilot wouldn't use the thinking level the user's
have set

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2026-04-20 14:33:18 +02:00
Tim Vermeulen
34dae654bc
editor: Cancel blame popover task when opening modal (#52525)
Update all direct calls to `Editor::inline_blame_popover::take` to now
be calls to `Editor::hide_blame_popover` as this ensures that the
popover is also not shown in case its task still hasn't finished.

This fixes a bug where the inline git blame popover could be shown even
after the user had opened a modal. 

Release Notes:

- Fixed the inline Git blame popover sometimes appearing after opening a
modal.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-04-20 12:31:48 +00:00
Danilo Leal
4fbac78ff4
sidebar: Open project header ellipsis menu on right-click (#54317)
This is just a refinement given it's pretty common for menus under
ellipsis icon buttons to also open as a context-menu through the mouse's
right-button click. This should make it slightly more convenient to
interact with this menu.

Release Notes:

- N/A
2026-04-20 09:30:41 -03:00
Cameron Mcloughlin
c95b41c75a
agent_ui: Add show thread metadata action (#54314) 2026-04-20 13:14:41 +01:00
Oleksiy Syvokon
72b41263f3
ep: Change kept_rate definition to a more intuitive one (#54306)
This change contains a number of fixes to make kept_rate more intuitive.
It also adds a CLI utility to print debug info on how the metric is
computed.

Release Notes:

- N/A
2026-04-20 14:03:26 +03:00
Gianni Chiappetta
f92178e6e5
theme: Associate .mlx extensions with OCaml (#54197)
See:
626cf8e761/languages/mlx/config.toml (L3)

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 is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Release Notes:

- Associate .mlx extensions with OCaml
2026-04-20 12:51:10 +02:00
Smit Barmase
559fcff870
recent_projects: Show project name in dev container suggestion notification (#54297)
Closes #52587

Release Notes:

- Improved the Dev Container suggestion notification to include the
project name, with the full path shown as a tooltip.
2026-04-20 15:28:15 +05:30
Danilo Leal
9daf886775
Move the worktree picker to the title bar + make it always visible (#54183)
This PR makes Zed only have one worktree picker, as opposed to a flavor
of it in the title bar and another in the agent panel. It then moves it
to the title bar, making it always present, so that its trigger is
separate from the branch picker (which now contains only two views:
branches and stashes). For the worktree picker, I'm mostly favoring the
behavior we've introduced in the agent-panel-flavored version.

It also updates the title bar settings migration to use the JSON
`migrate_settings` helper instead of a shallow Tree-sitter rewrite, so
old `show_branch_icon = true` values are promoted to
`show_branch_status_icon = true` across root, platform, release-channel,
and profile settings scopes.

- [x] Move worktree creation logic to the `git_ui` crate to make this
more generic and less agent-specific
- [x] Double-check the remote use case and ensure nothing broke there
- [x] Improve the UX for the detached HEAD state; better invite people
to create a branch
- [x] Migrate `show_branch_icon = true` to `show_branch_status_icon =
true` across nested settings scopes

Suggested .rules additions

When migrating renamed settings keys that can appear in platform
overrides, release-channel overrides, or profiles, prefer the JSON
`migrations::migrate_settings` helper over shallow Tree-sitter key
rewrites unless tests explicitly cover every nested scope that can
contain the key.

Release Notes:

- Improved migration of the title bar branch status icon setting.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-04-20 09:29:51 +00:00
Malin von Matern
9e2c493b86
Fix info colors used for hint diagnostics (#54046)
Super small update changing two instances where
`DiagnosticSeverity::HINT` was set to use the color for "info".

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

Closes #45637

Release Notes:

- Fixed various instances of hint level diagnostics using the color
designated for info
2026-04-20 08:53:15 +00:00
Pedro Guedes
32fa09132e
workspace: Skip read-only paths when choosing default save location (#53100)
Fixes #42787

## Summary

- When "Go to Definition" navigates into a dependency (e.g. `.venv/`,
`node_modules/`), the save dialog for new files defaulted to that
directory
- `most_recent_active_path` now checks the `read_only_files` setting and
skips matching paths, falling back to the next eligible path, the
worktree root, or the home directory

## Design tradeoffs

We considered three approaches:

1. **Filter by `is_ignored`/`is_hidden`/`is_external` on worktree
entries** — catches `.venv` when gitignored or when it's a dotfile, but
also false-positives on directories like `.github/workflows/` that users
intentionally edit.

2. **Use preview tab status** — "Go to Definition" opens files as
preview tabs, so skipping preview paths targets the right intent. But it
doesn't work when preview tabs are disabled, and the signal is transient
(preview status changes as you interact with tabs).

3. **Use `read_only_files` setting** (this PR) — an explicit user
declaration of "I never want to edit files here." If you can't edit
them, you don't want to save new files next to them either. This is the
clearest signal of intent and respects user configuration. The tradeoff
is that `read_only_files` is empty by default, so users need to
configure it. But the kind of user bothered by the save dialog
defaulting to a dependency directory is the same kind of user who
already configures `read_only_files` (see
[#46827](https://github.com/zed-industries/zed/discussions/46827) for an
example).

## Test plan

- [x] Manual test: configured `read_only_files: ["**/.venv/**"]`, opened
project, Go to Definition into `.venv`, created new file — save dialog
defaults to project root
- [x] Added `test_most_recent_active_path_skips_read_only_paths`
- [x] All existing workspace tests pass

Release Notes:

- Fixed save dialog defaulting to dependency directories (e.g. `.venv/`,
`node_modules/`) after using Go to Definition, when those directories
are configured as `read_only_files`.

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
2026-04-20 08:45:48 +00:00
Om Chillure
82e7917e08
diagnostics: Hide Inline Assist toolbar button when agent is disabled (#52706)
### 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 is consistent with the UI/UX checklist
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

#### Closes #52702

### Video 

[Screencast from 2026-03-30
13-17-08.webm](https://github.com/user-attachments/assets/8b0f6927-04d2-406b-b7fd-064a730b2f86)

Release Notes:

- Fixed the Inline Assist button showing in the Project Diagnostics
toolbar when the agent is disabled.
2026-04-20 10:11:55 +02:00