Commit Graph

5134 Commits

Author SHA1 Message Date
tidely 4fd48c02ac Miscellaneous improvements to prepare for Rust 1.100 (#66901)
## Summary

Fixes rustc and clippy warnings for a potential upcoming Rust 1.100
version bump. All changes are backwards compatible and Rust is **not**
bumped in this PR.

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

- N/A
- [GPUI] N/A

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
2026-11-13 11:45:35 +00:00
Ryan The Dev 27bbbc1cc4 languages: Highlight C/C++ preprocessor call arguments (#66875)
## Summary

Arguments of `preproc_call` nodes, like the `pack(push, 4)` in `#pragma
pack(push, 4)` or the `FOO` in `#undef FOO`, had no highlight capture,
so they always rendered as plain text. `#define` bodies are covered by
the injection, and `#if` conditions are parsed as expressions, but
nothing reached `preproc_call`'s `preproc_arg`.

I added a `(preproc_call argument: (preproc_arg) @preproc)` rule to both
the C and C++ highlight queries. I went with `@preproc` because every
built-in theme already defines it, and it makes the whole directive line
one color, like VS Code does. Happy to switch to `@constant.macro` or
`@string` if you'd prefer.

| Before | After |
| --- | --- |
| <img alt="preproc-before"
src="https://github.com/user-attachments/assets/95fa0660-c41f-4433-98c7-887d9871fe1d"
/> | <img alt="preproc-after"
src="https://github.com/user-attachments/assets/7c4fa978-a6c1-4707-a627-6d7e32dd897a"
/> |
| <img alt="preproc-before-light"
src="https://github.com/user-attachments/assets/3d2479ce-cd04-42ae-bfeb-e5c8c49fb9a6"
/> | <img alt="preproc-after-light"
src="https://github.com/user-attachments/assets/8d342f73-25e2-4dae-b984-72b88fd23287"
/> |


`#define FOO 1` and `#if defined(BAR)` look the same before and after.

Closes #66675

## Testing

- Added a query test for C and one for C++, checking that `#pragma` and
`#undef` arguments are captured as `preproc` and that a `#define` body
isn't. Both fail without the query change.
- `cargo test -p languages` passes (105 tests), and `./script/clippy -p
languages` is clean.
- Built the branch on macOS and compared it with Zed 1.28.1 on the same
file, in One Dark and One Light (screenshots above).

To try it: open a `.c` or `.cpp` file and type `#pragma pack(push, 4)` /
`#undef FOO`. The arguments should now take the directive's color.

I used Claude Code to help with this change and tested it myself.

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

- Improved syntax highlighting of `#pragma` and `#undef` arguments in C
and C++.

---------

Co-authored-by: imryanthedev <352313849+imryanthedev@users.noreply.github.com>
2026-11-12 22:39:26 +00:00
Kirill Bulatov 78a8526196 Update merman to 0.9.3 (#66874)
Closes #66582
Closes #62410
Closes #62913
Closes https://github.com/zed-industries/zed/pull/65192

* Label measurement
merman 0.9 no longer ships font metrics, and sizes label boxes from a
font-agnostic estimate.
`SvgRenderer::measure_text_width` lays out a line with the renderer's
own `usvg` options, and merman's width callback uses it, so layout and
painting share font matching, fallback and shaping.
This also fixes labels overflowing their nodes with a wide UI font.

* Font data
`fontdb` reopens and maps a file-backed font on every glyph lookup,
which made each measurement with a system font cost 1 to 5ms.
The SVG renderer now reads each font file selected for text once, within
a 64MiB total budget, and serves later lookups from memory.
A 36-character measurement with Menlo went from 2.8ms to 0.06ms.

* Configuration
merman 0.9 follows Mermaid 12 defaults: the `neo` look, 120px wrapping
and a 120px minimum node width.
Zed keeps the classic look, 200px wrapping and no minimum width, as
before.
merman also stopped restricting `themeVariables` in diagram directives;
Zed restricts it again, together with `fontSize`.

* Styling
merman now defines label text once in `<defs>` and references it with
`<use>`, so descendant selectors and position lookups no longer reach
it.
Node accents, mindmap section colors and edge label backgrounds are
adapted to that structure.
Label typography comes from merman instead of a forced 16px, and label
viewports are not clipped.

* Limits
* Text measurement has a per-render work budget, so a label of
zero-width characters fails the render instead of measuring ever longer
prefixes.
* merman 0.9.3 has a hard-coded limit on CSS matching work in its label
fallback.
Flowcharts above about 310 nodes and class diagrams above about 375
members fail with `svg_fallback_selector_index exceeded`.
`main` renders 500 nodes and 400 members.

* Behavior changes
* ER relationship labels are 14px, merman's size; they were forced to
16px.
* A `gantt.fontSize` directive is ignored, because `fontSize` is
restricted at any depth.
* A per-node `font-size` style is now painted; before, only the node box
grew.
    * A single label line above roughly 90KB fails to render.

### Known regression


Release Notes:

- Fixed Mermaid state descriptions overlapping in the Markdown preview.
- Fixed Mermaid sequence diagram titles being cut off.
- Fixed Mermaid labels overflowing their nodes with wide fonts.
- [GPUI] Added `SvgRenderer::measure_text_width`, and made SVG text
rendering keep used font files in memory.
2026-11-12 14:52:36 +00:00
John Tur be07e43ea0 gpui: Reduce overdraw using the depth buffer (#66811)
GPUI paints a frame by recording primitives (quads, shadows, paths,
underlines, glyph sprites, surfaces) into a `Scene`. The renderer then
draws the scene's primitives back to front, so that later primitives
paint over earlier ones. This means every pixel of every primitive is
shaded, even where a later primitive completely covers it. In heavily
nested UI, this adds up to a lot of overdraw.

Inspired by WebRender, we reduce overdraw with a depth buffer and two
passes:
- The opaque pass draws quads that we know cover their whole area with
an opaque color. They're drawn front to back, with depth testing and
depth writes enabled. In practice, we can only make this guarantee for
quads with a solid, fully opaque fill and no rounded corners.
- The blended pass draws everything else back to front, with depth
testing enabled but depth writes disabled. This is essentially the
existing render loop with a depth test added. Any fragment 'behind' an
opaque quad fails the depth test and is never shaded.

To get more of each frame into the opaque pass, `paint_quad` now splits
any quad with rounded corners into a rectangular interior and the four
edge strips around it. The interior is a plain rectangle, so if its fill
is solid and opaque, it's drawn in the opaque pass, and only the strips
need the border and corner shading.

Measured on an Intel HD 4600:

Scene | Before | After | Change | Pixel shader invocations |
|---|---|---|---|---|
| Editor | 3,941µs | 1,689µs | −57% | 3.71M → 1.65M (−55%) |
| Command palette | 7,658µs | 2,275µs | −70% | 5.33M → 1.80M (−66%) |
| Git Graph | 3,589µs | 1,889µs | −47% | 3.13M → 1.65M (−47%) |

Fixes https://github.com/zed-industries/zed/issues/8043

Release Notes:
- Reduced GPU usage
- [GPUI] Improved rendering performance by skipping pixels hidden behind
opaque quads
2026-11-12 08:19:31 +00:00
John Tur ffe0fa29e4 gpui: Improve path rendering (#66809)
GPUI currently implements paths in two ways:

- A remnant of a Loop-Blinn shader (which doesn't quite work because the
winding accumulation is missing).
- Tessellating paths on the CPU with `lyon` and uploading the triangles
to the GPU.

Tessellated triangles have no curve coordinates, so Loop-Blinn's
analytic antialiasing doesn't help them. To antialias them, we used 4x
MSAA instead. This was particularly problematic:

- MSAA has an enormous bandwidth and memory cost relative to the quality
of the result (5 coverage levels).
- Many lower-end GPUs can't afford MSAA on the main render target. So,
paths rendered into a separate MSAA target, which was resolved into an
intermediate texture and then drawn onto the main target. These textures
cost extra memory.
- The MSAA draw and resolve happened per path batch. We didn't use a
single path atlas, because in principle its memory use is unbounded.
This dramatically magnifies the bandwidth cost of path rendering,
especially on tile-based GPUs, since every batch switches render passes
mid-frame.

We present a new path renderer that computes analytic coverage per pixel
from the winding number. Coverage is computed as in Eric Lengyel's Slug:
we cast rays leftward and upward from the pixel and count crossings with
the path's curves. Crossings within the pixel contribute partial
winding.

GPUI paths can be larger and more complex than glyphs. But since they're
built at a fixed scale in screen space, we can do some of the spatial
work on the CPU:

- `PathBuilder` turns each contour into closed chains of monotone
quadratic curves.
- The curves are binned into square cells, where each cell lists only
the curves near it. Cell size is picked per path to balance binning cost
against shading cost.
- For each cell, the CPU computes a *backdrop* value that encodes the
winding contribution of all the curves it doesn't list.
- Neighboring cells with the same curve list and backdrop merge into
rectangular tiles. A large rectangle becomes nine tiles: four corners,
four edges, and a solid interior with no listed curves.
- Each tile is one GPU instance, and the shader loops only over that
tile's curves.

Tiles are drawn in the main render pass alongside every other primitive.
There's no MSAA, no intermediate textures, no extra render passes or
resolves, and no tessellation.

---

Binning has a different cost profile from tessellation:

- The tessellator's work happened almost entirely in
`PathBuilder::build()`. Binning depends on the display scale, so it
happens in `paint_path`. Code that caches and reuses `Path`s pays
binning cost on every paint. However, this doesn't seem to be a common
pattern, so mitigations are deferred.
- In general, fills are about as fast as before or slightly faster,
while strokes are 2–8× slower. `lyon` has a dedicated stroke tessellator
that emits triangles directly along the stroke. We convert the stroke to
an outline with `tiny-skia`, then bin it like any other fill. Long,
sprawling strokes are the worst case (a 1,000-point scribble takes about
1.5ms now vs 0.2ms before).


GPU time is, generally, reduced dramatically. Measured on an Intel HD
4600:

| Scene | Before | After | Change | Pixel shader invocations |
|---|---|---|---|---|
| `painting` example | 9,257µs | 1,928µs | −79% | 1.81M → 1.50M (−17%) |
| Git Graph | 19,669µs | 3,828µs | −81% | 3.21M → 3.13M (−2%) |

---

Some breaking changes were made to the API:

- `Path` is no longer generic and can only be built with `PathBuilder`.
Use `PathBuilder`'s equivalents of `Path`'s builder methods.
- `PathBuilder` can still be populated from `lyon` path builders, but
the places where `lyon`'s tessellator leaked into the API were removed.
`StrokeOptions` and `FillOptions` are now GPUI types with fewer options,
and `PathBuilder::build_path` is gone.
- Since paths now render with analytic antialiasing, you may see
conflation artifacts where MSAA didn't have any.

Release Notes:
- Reduced GPU usage
- [GPUI] Improved path rendering performance. `Path` is no longer
generic and must be built with `PathBuilder`

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-11-12 08:19:30 +00:00
Anthony Eid 3d42ca7c09 cli: Add debug state command (#66852)
This PR adds a debug state command to the CLI and a `cx.debug_state` API
to GPUI's `App`, so users can better understand where things went wrong
in their GPUI apps when they run into a bug. `zed --debug-state` prints
the running instance's snapshot as JSON.

Release Notes:

- Added a `zed --debug-state` CLI flag that prints the running app's
window, display, and platform state as JSON for debugging
- [GPUI] Added `cx.debug_state` API to output the current GPUI state
2026-11-11 19:41:39 +00:00
Ben Brandt 5014e5b302 Update ACP SDK to 5.2.0 and adopt schema 1.17 additions (#66832)
Updates `agent-client-protocol` to 5.2.0 (schema 1.17.0) and adopts its
new additions.

- **Session references in tool call content.**
`ToolCallContent::Session` (unstable subagents) used to render as
"Unsupported tool call content." for v2 agents and was dropped for v1
agents. It now renders as an "Open Session" link that switches to the
referenced session, labelled the same way as session-message
participants. Because references are display-only, sessions Zed doesn't
know about show as "Unavailable Session" and aren't loaded.
- **Saved config defaults sent inline with `session/new`, behind the ACP
beta flag.** If the agent advertises `sessionCapabilities.options`, Zed
now sends the user's saved config defaults in the session-creation
request (`configOptions`) instead of only applying them one
`session/set_config_option` call at a time afterwards. This covers v1
and v2. `session/options` is still a draft, so this only happens with
`acp-beta` enabled. The existing one-at-a-time pass still runs after
creation: it sends nothing when the agent already applied everything,
and it still catches defaults the agent skipped (for example, one that
depends on another option's value).
- The `session/options` request itself is not used yet.
- `AuthAccount.description` is not adopted, because Zed doesn't use auth
status.

Release Notes:

- N/A
2026-11-11 17:29:24 +00:00
zed-zippy[bot] cd4902bfa2 Bump Zed to v1.30.0 (#66839)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-11-11 15:36:49 +00:00
Divyanshu Singh cffa8d94a8 which_key: Don't dismiss open modals when showing pending bindings (#66630)
## Summary

With which-key enabled, pausing in the middle of a multi-key binding
closes whatever modal is open. I hit this with vim mode in the expanded
commit editor: pressing `g` and waiting for the which-key popup closed
the editor. The same thing happens with `cmd-k` in pickers like Go to
Line, so their `cmd-k` chords can't be completed.

The cause is that the modal layer only holds one modal at a time, and
which-key opens as a modal. Before opening, it only checked whether a
which-key popup was already open, so any other modal got replaced.

I changed that check to skip the popup while any modal is open. The open
modal stays, and the chord still completes inside it. The trade-off is
that the popup isn't shown inside modals, but pending keys are still
shown in the status bar (by the pending keystrokes indicator, or by the
vim mode indicator in vim and Helix mode).

Closes #66068
Closes #66246

## Testing

- Added `test_which_key_does_not_replace_open_modal`, which opens a
modal, starts a chord, pauses, then completes it, and checks that the
modal is still open and the chord's action ran. It fails without the
fix.
- Added `test_which_key_shows_for_pending_chord` to make sure the popup
still shows when no modal is open.
- Tested manually on macOS with vim mode and which-key enabled.

Steps to reproduce:
1. Set `"vim_mode": true` and `"which_key": { "enabled": true,
"delay_ms": 1000 }`
2. Open the Git panel (`ctrl-shift-g`), click the commit message box,
and press `shift-escape`
3. Press `Escape`, then `g`, and wait a second
4. Before: the commit editor closes. After: it stays open.

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

- Fixed which-key closing the commit editor and pickers when a multi-key
binding was pending

---------

Co-authored-by: Divyanshu Singh <177622442+divyanshus2404@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-11-11 13:02:28 +00:00
Kyle Kelley b1962f7cd8 repl: Update Jupyter dependencies (#66220)
## Summary

Upgrades jupyter deps to latest versions. This also brings us forward to
a version without async-std so that we can go all in on smol or tokio as
needed.

## Testing

Beyond the test suites, ran notebooks and repl code for some nice
quality human QA.

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

- N/A

---------

Co-authored-by: MrSubidubi <75036051+MrSubidubi@users.noreply.github.com>
2026-11-10 13:38:24 +00:00
Ben Brandt 1fea6cbaf6 Bump agent-client-protocol to 5.1.0 (#66748)
Updates the ACP Rust SDK from 5.0.0 to 5.1.0. This also updates
`agent-client-protocol-derive` to 5.1.0 and
`agent-client-protocol-schema` from 1.15.1 to 1.16.0. No code changes
were needed.

Release Notes:

- N/A
2026-11-09 16:19:59 +00:00
Kirill Bulatov 5e23b6e71d Open single files inside the same window (#66103)
Part of https://github.com/zed-industries/zed/issues/55726
Closes https://github.com/zed-industries/zed/issues/55893


https://github.com/user-attachments/assets/3926b9a1-019b-4c37-bcfc-0d5a0e30146b


Release Notes:

- Fixed single file opening ergonomics
2026-11-09 12:08:31 +00:00
guopenghui 94f3eb1b72 Bookmark picker (#60005)
# Objective

- Add a picker for bookmarks to view all bookmarks in the workspace,
with support for filtering, previewing, opening files and jumping to
corresponding positions.

## Solution

- Add a picker delegate and related actions to pop up a picker modal
displaying the bookmark list upon trigger
- Display the label of the bookmark, its file path and line number. If
the bookmark label is empty, use the text on the line where the bookmark
is located as the label.
- Support enabling preview to view surrounding code of bookmarks
simultaneously
- Open the preview tag and reuse the existing tab pane on primary
confirm; open a separate tab pane on secondary confirm
- Design distinct result display layouts for horizontal and vertical
modes to prevent excessive text truncation

## Testing

- Conducted manual testing
- Added two test cases
## 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/4126fec0-0177-4f05-8cd8-738e6c358164




## Current Limitations
- The current picker does not provide initial layout information to its
delegate. If it is opened in horizontal mode initially, the result list
will render in vertical mode, causing severe text truncation. This issue
should be straightforward to resolve with minor adjustments to the
picker-related code. #60007
- The current preview highlights bookmark rows by matching the full line
of text, which results in an unappealing visual effect. It would be
preferable if the picker code could support full-row highlighting
natively in a future update.

---

Release Notes:

- Added a picker to show all bookmarks inside current workspace
2026-11-08 18:27:50 +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
Aliaksandr Zhyburtovich d71ff73440 tasks_ui: Fix tasks with file variables missing for single-file worktrees (#66195)
## Summary

When a single file is opened without a folder (e.g. via `ctrl-o`), it
gets a worktree whose root is the file itself. `task_contexts` only
built the editor context for items from worktrees rooted at a directory,
so variables like `ZED_FILE` were never set. Tasks referencing them,
including global tasks from `~/.config/zed/tasks.json`, failed to
resolve and were silently dropped from `task: spawn`. Tasks without
variables were still listed, which made the bug look inconsistent.

This PR:

- builds the editor context for any active item with a project path,
while keeping the worktree context limited to directory worktrees (as
introduced in #25605);
- makes `BasicContextProvider` set `ZED_WORKTREE_ROOT`, the relative
path variables and the default cwd only for visible directory worktrees,
so they don't point at the file itself or at an unrelated directory such
as the Zed config directory;
- moves the task picker's source-aware context selection into
`TaskContexts` and uses it when spawning tasks by name or tag, so
worktree tasks are resolved against their own worktree even when an
external file is active;
- gives items outside of visible directory worktrees (e.g. the global
`tasks.json` opened via `zed: open tasks`) the visible project's
`ZED_WORKTREE_ROOT` and cwd, preserving the behavior from #55727, and
keeps only their file and cursor variables, so nothing derived from
their own worktree (relative paths, git repository, language-provided
values such as Python test targets) leaks next to the project's root;
- uses the first visible directory worktree, skipping single-file ones,
as the active worktree when the active item is not in a visible
directory worktree, so the fallback above and the worktree context still
apply when a standalone file was opened before a folder was added to the
project.

As a side effect, language tasks (e.g. Python runners) now also show up
for single-file worktrees, since the active location is no longer
dropped.

Closes #66148

## Testing

- Added `test_single_file_worktree_provides_file_context`: the item
context of a single-file editor contains `ZED_FILE`, has no
`ZED_WORKTREE_ROOT` and no `cwd`.
- Added tests that spawn a worktree-local task by name, or rerun it with
`reevaluate_context: true`, while a file-backed external editor is
active (single-file and invisible directory worktrees): the task
resolves against its own worktree and doesn't get the external file's
`ZED_FILENAME`.
- Added
`test_spawn_by_name_resolves_global_task_with_global_tasks_file_editor_active`:
with a file-backed global `tasks.json` editor from an invisible worktree
active, a global task gets the visible project's root and cwd, keeps
`ZED_FILENAME` and has no `ZED_RELATIVE_FILE`.
- Added
`test_spawn_by_name_resolves_global_task_with_single_file_worktree_listed_first`:
the same check with a visible single-file worktree listed before the
visible directory worktree.
- Extended
`test_external_item_context_does_not_carry_its_worktree_environment`: an
external item's `ZED_MAIN_GIT_WORKTREE` and language-provided variables
don't reach global tasks.
- Added
`test_spawn_by_name_does_not_use_language_targets_derived_from_external_relative_path`:
with the built-in languages registered and a Python file from an
invisible worktree active, the real `PythonContextProvider` derives a
relative `ZED_CUSTOM_PYTHON_TEST_TARGET` for the editor, but a global
`pytest` task spawned by name gets the `.` default and the visible
project's cwd.
- `cargo test -p tasks_ui` and task-related tests in `project` pass.
- Manually reproduced on Linux before the fix: with global tasks using
`$ZED_FILE` and a task without variables, only the latter was listed for
a file opened via `ctrl-o`, while both were listed with a folder opened.
- Manually verified on Linux after the fix: global tasks using
`$ZED_FILE` are listed and run for a file opened via `ctrl-o`.
- `./script/clippy` passes.

To test: add a global task with `"command": "echo $ZED_FILE"`, open a
file via `ctrl-o` in an empty window, run `task: spawn`.

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

- Fixed tasks that use file variables such as `$ZED_FILE` not being
listed in `task: spawn` when a single file is opened without a folder.
2026-11-04 15:54:12 +00:00
zed-zippy[bot] b278e79c97 Bump Zed to v1.29.0 (#66532)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-11-04 15:35:50 +00:00
Finn Evers 8a41a5cc04 crates_io_client: Add GitHub Trusted Publishing configuration endpoints (#66473)
As a next step, this PR adds the trusted publishing endpoints to the
crates.io API client.

Also slightly improves our pagination handling for crates.

Release Notes:

- N/A
2026-11-04 09:13:14 +00:00
Finn Evers 4ebf3eac14 crates_io_client: Add endpoints for listing, getting, and updating crates (#66438)
As a next step, this adds endpoints to the API client for crates.io to
query a list of crates as well as patch a crate and get crate info. Also
follows the OpenAPI spec available from crates.io.

Release Notes:

- N/A
2026-11-03 11:35:14 +00:00
Finn Evers ccb25cbc63 crates_io_client: Add crates.io API client (#66437)
Adds a `crates_io_client` tooling crate for the crates.io REST API:

- `RealCratesIoClient` authenticates with an API token and follows the
crates.io data access policy (https://crates.io/data-access).
- Errors distinguish missing permissions (401/403), missing resources
(404), and other upstream failures.
- `SimulatedCratesIoClient` (behind `test-support`) serves in-memory
responses.

For testing this, this PR also adds the `GET /api/v1/site_metadata` as a
first endpoint.

Release Notes:

- N/A
2026-11-03 11:14:40 +00:00
Piotr Osiewicz f73feed9de http_client: Remove anyhow reexports (#66430)
## Summary

What problem does this solve, how, and why does this change matter?
Use "Closes #123" for each issue resolved.
Include artifacts produced when testing: before/after screenshots, GIFs,
videos, benchmarks.

## Testing

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

## Self-review

- [ ] 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:

- [GPUI] http_client no longer re-exports anyhow types.

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-11-02 15:51:56 +00:00
Ben Brandt 4ec98df500 acp: Update agent-client-protocol to 5.0.0 (#66425)
Upgrades `agent-client-protocol` from 3.6.0 (schema 1.13.0) to 5.0.0
(schema 1.15.1), and brings Zed's v1 and v2 ACP clients in line with the
spec and schema changes made since then.

## SDK 5 port

- Schema types move from `schema::v1`/`schema::v2` to
`v1::schema`/`v2::schema`, builders to `Client.v1()`, and v2 handle
types to `agent_client_protocol::v2`.
- `agent_client_protocol::Error` is now the SDK's own type, not the v1
schema error. Zed uses it at the SDK boundary, and `ProtocolErrorInfo`
also recognizes it so auth-required detection keeps working.
- Foreground dispatch helpers are generic over the protocol marker, and
v2 request IDs come straight from the handles.
- SDK 5 only matches transport-closed errors that the SDK itself
produced, so peers can't forge them. A test that built one by hand now
covers only the local disconnect case. The `agent_servers` tests still
cover real transport loss.

## Spec changes

- `session/close` and `session/delete`: a `-32002` response counts as
success, on both v1 and v2.
- Permission and elicitation requests that name an unknown session get
`-32002` with `data.sessionId` instead of `-32603`. The v2 migration
guide makes this required for Clients too.
- v2 `usage_update.cost` is a patch field: omitted leaves it unchanged,
`null` clears it. A v1 update without a cost still leaves it unchanged.
- A `plan_update` whose type Zed can't render (`file`, `markdown`, or an
unknown type) still replaces the plan with that `planId`, so the old
entries stop showing.
- A diff `patch` with an unrecognized `format` renders from `changes`,
as if `patch` were omitted.
- v2 never sends an empty prompt.
- On v2, `session/cancel` no longer answers pending permission requests
locally. They stay open until the agent cancels them with
`$/cancel_request`, because requests for background work survive a
cancel. v1, including v1 subagents, keeps answering them with
`cancelled`.

## Follow-ups

These are left for separate PRs:
- Background-work UI: the `paused` status, the `background` list, and
cancel buttons for tool calls and terminals. Until then, `paused`
displays as in progress, which the spec allows.
- Subagent `cwd` and `additionalDirectories`.
- The new unstable methods: `auth/status`, `session/set_title`,
`session/status`, `session/archive`.

Release Notes:

- Improved compatibility with the latest Agent Client Protocol,
including handling of missing sessions, plan updates, diff formats, and
cancellation of permission requests.
2026-11-02 15:26:50 +00:00
max1ab 1d76f828ee Fix SVG images in remote Markdown previews (#66404)
## Summary

<img width="3024" height="1898" alt="zed-svg-ssh-after"
src="https://github.com/user-attachments/assets/d35454cc-9d27-4165-900a-00990f483e4e"
/>

Closes #64517

Fixes SVG images failing to display in remote Markdown previews by
adding content-based SVG support to ImageStore and using the existing
GPUI renderer.

## Testing

- Integration tests and Clippy passed.
- Manually verified with a macOS client connected to a Linux SSH
project.
- To verify: open a remote Markdown file containing `![](image.svg)` and
confirm the SVG displays in the preview.

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

- Fixed SVG images failing to render in Markdown previews for remote
projects.
2026-11-02 09:16:49 +00:00
Steve Shreeve 0373366f43 gpui_macos: Fix animations running at 30 fps on M5 Macs (#65472)
## Summary

**This fixes a major slowdown in GPUI apps on M5 Macs (and, per the
reports below, other base M-series Macs on macOS 26+).** Every frame
blocked the main thread for about 33 ms, which capped animation at 30
fps and delayed input handling; with this change a frame takes under 1
ms and animation runs at the display's full rate.

On an Apple M5 (base chip; macOS 27.0.1; Studio Display at a fixed 60
Hz), GPUI animations that aren't driven by input run at 30 fps on
`main`. Zed's own `crates/gpui/examples/animation.rs` never goes above
30 fps, even in a focused window. With `ZED_MEASUREMENTS=1`, each
frame's draw plus present takes about 33 ms while the scene itself takes
about 3 ms; the rest is spent blocked in `-[CAMetalLayer nextDrawable]`.
Input hides it: while the mouse moves, frames run at 60 Hz, presumably
because input raises the system's performance state.

This matches reports outside Zed: about 30 fps UI animation on base
M4/M5 chips since macOS 26 ([Apple forum
839102](https://developer.apple.com/forums/thread/839102)),
Psychtoolbox's finding that macOS 26 moved the compositor deadline close
to vsync so a frame submitted after the vsync callback slips a refresh
([thread](https://psychtoolbox.discourse.group/t/timing-performance-issues-on-macos-26-tahoe/5767/32)),
and another app on the same GPUI crates measuring about 32 ms in
`nextDrawable`
([karan-vk/Oxikube#601](https://github.com/karan-vk/Oxikube/issues/601)).
In #46728 a maintainer suggested moving to CADisplayLink or
CAMetalDisplayLink.

## What changed

On macOS 14 and later, each window is paced by a `CAMetalDisplayLink` on
its layer, and the renderer draws into the drawable the link hands out
instead of calling `nextDrawable`. Earlier systems keep the existing
`CVDisplayLink` path unchanged.

- **The OS picks the rate.** The link keeps Apple's default
`preferredFrameRateRange` (the display's maximum rate, adjusted by
system policy such as Low Power Mode and thermal state) and default
`preferredFrameLatency`. There is no hand-picked frame rate or fallback.
- **Shared Apple wrapper.** `gpui_apple::display_link::MetalFrameSource`
owns the link and its delegate. It is confined to the main thread
(`MainThreadMarker`, `MainThreadOnly` delegate), delivers updates
through a typed Rust closure, and `new` returns `None` where
`CAMetalDisplayLink` is unavailable. iOS can adopt it later; iOS still
uses its existing `CADisplayLink` here.
- **The renderer can't call `nextDrawable` while a link drives the
layer.** A `DisplayLinkMode` enum makes that state explicit; a frame
drawn outside a link update while attached is skipped and logged.
Activation and live resize draw synchronously, so they detach
(invalidate) the link first and recreate it afterwards.
- **Idle windows stop the link.** After an update in which GPUI neither
drew, presented, nor asked for another frame, the link pauses, so an
idle window acquires no drawables. GPUI's existing `frame_waker` and
`schedule_frame` hooks resume it; macOS didn't implement them before,
and they're no-ops on the `CVDisplayLink` path. GPUI still owns every
frame decision, including presenting for a second after high-rate input,
so there is no backend timer.
- **macOS window cleanup.** The frame source is an enum (Metal or
`CVDisplayLink`), the window state is `Rc<Mutex<…>>` instead of `Arc`
plus `unsafe impl Send`, and window teardown invalidates the link.

## Testing

**Frame rate (Apple M5 base, macOS 27.0.1, 60 Hz Studio Display;
measured on the original revision).** Zed's `animation` example,
`--profile release-fast`, frames per second in each second:

- `main`: 30 in every focused second (never above 30), 22 to 25 while
unfocused
- this branch: 60 in every focused second, 22 to 24 while unfocused
(GPUI's unfocused-window cap)

A scripted scroll benchmark in an app built on these crates (44
identical wheel flicks injected with `Window::dispatch_event`, including
a spring animation after each):

| | CVDisplayLink | CAMetalDisplayLink |
|---|---|---|
| Frames with no input, at 60 Hz | 0% (100% at 30 Hz) | 97% |
| Frames while input arrives, at 60 Hz | 22% | 91% |
| Median frame time (draw + present) | 33.1 ms | 0.5 to 0.7 ms |
| Time to run a 25.4 s script | 31.1 s | 26.6 s |

**Idle cost (Apple M4 Max, macOS 27.0.1, built-in 120 Hz ProMotion
display, AC power, Low Power Mode off).** GPUI `hello_world` and
`animation` examples (dev builds), `main` and this branch built from the
same base, display kept awake. Each idle run is 60 s after a 10 s
warmup; numbers are `top`'s %CPU and energy impact:

| | App CPU | App energy impact | App idle wakeups/s |
|---|---|---|---|
| `main`, idle `hello_world` (3 runs) | 0.96–1.02% | 2.37–2.84 | 30–40 |
| Link always running, idle `hello_world` (2 runs) | 1.93–2.19% |
1.93–4.47 | — |
| This branch (idle pause), idle `hello_world` (3 runs) | 0.00% | 0.00 |
~0.1 |
| `main`, `animation` (30 s) | 23.1% | 24.4 | — |
| This branch, `animation` (30 s) | 21.0% | 22.2 | — |

Without the idle pause, an idle window cost about twice `main`'s CPU
because the link acquires a drawable every refresh; with it, an idle
window does no work at all. The `animation` run checks that a paused
link resumes and keeps rendering. WindowServer showed no consistent
difference, though some runs overlapped with the machine being in use.

Also verified by hand on the M4 Max: idle, animation, and live resize
after the final revision.

Checks: `cargo clippy -p gpui_macos -p gpui_apple --tests` is clean;
`cargo test -p gpui_macos -p gpui_apple` passes, including tests for the
renderer's display-link drawable handling, the idle-pause decisions
(including a wake that arrives during an update), and drawing normally
once a link is invalidated. `gpui_apple` also type-checks for the iOS
simulator at the iOS 15 deployment target.

**Not yet measured:** whether the first frame after an idle pause (e.g.
the start of a scroll) arrives later than with an always-running
`CVDisplayLink`; whether the idle pause lets ProMotion drop its refresh
rate more (expected, not measured); Low Power Mode; macOS 14 and 15;
multiple displays and moving a window between them.

**Open questions for review:**

- **Live resize recreates the link on each resize step.** The
synchronous `displayLayer:` draw detaches the link, and starting the
source creates a new one. Resizing works, but a cheaper approach (e.g.
restarting the link once when live resize ends) could follow.
- **One frame may mismatch during a programmatic resize.** A frame is
sized from the link's drawable while the path-rendering intermediate
textures follow the layer's newer size, so the two could differ for that
frame. Not observed.

## 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). (No UI
changes.)
- [x] Tests cover the new or changed behavior. (Frame rate and idle cost
need a display and were measured by hand, as above.)

Release Notes:

- [GPUI] Improved animation frame rate on macOS: frames are paced by
`CAMetalDisplayLink` on macOS 14 and later, so animations reach the
display's refresh rate instead of 30 fps on some Macs, and idle windows
stop requesting frames

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-10-29 16:25:45 +00:00
Piotr Osiewicz 5882c67dc3 notification: Remove unreferenced bits (#66294)
Following removal of notification panel there should be opportunities to
remove some (all??) of notification crate

## Summary

What problem does this solve, how, and why does this change matter?
Use "Closes #123" for each issue resolved.
Include artifacts produced when testing: before/after screenshots, GIFs,
videos, benchmarks.

## Testing

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

## Self-review

- [ ] 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-29 14:33:41 +00:00
Ben Brandt 33156f0d81 language_model: Stream background events through async-channel (#66290)
`stream_in_background` forwards a model's events from a background task
through a bounded `futures::channel::mpsc`. When the 32-event buffer
fills, that channel parks the sender behind a `std` mutex that the
receiver also locks to wake it.

On the web the receiver polls on the browser's main thread, and the
producer runs on a Web Worker. Waiting on a contended `std` mutex on the
main thread traps with `Atomics.wait cannot be called in this context`,
which can happen whenever rendering falls behind a model stream.

`async_channel::bounded` keeps the same backpressure without that mutex.
`gpui_web`'s HTTP response body already uses it for the same reason.

Release Notes:

- N/A
2026-10-29 13:16:06 +00:00
Lukas Wirth 2c2f737ab2 gpui: Add sendable foreground execution for web HTTP clients (#66165)
## Summary

This cleans up the gpui_platform code a bit, and in combination the way
we set up the http client for the web. This does introduce a
`ForegroundExecutor` variant that it itself is Send-able, allowing to
dispatch foreground futures from background workers (by requiring the
future to be Send, unlike `ForegroundExecutor`), which is a requirement
for web fetch.

a31c7b54c60738b82524e4e4c12aec2f6caf101d fixes a bunch of warnings with
our binary names

Release Notes:

- [gpui] N/A
2026-10-29 09:12:10 +00:00
Tim Vermeulen f0210f1621 gpui: Use UAX #14 line breaking for text wrapping (#64624)
Replaces the `is_word_char` list with Unicode line breaking ([UAX #<!--
-->14](https://www.unicode.org/reports/tr14/)) using the `icu_segmenter`
crate.

`is_word_char` can't express line breaks that depend on both neighboring
characters, so currently wrapped lines sometimes start with `/` or `?`,
and some emojis like 👍🏽, 🇯🇵, and 👩‍💻 get incorrectly split across lines:


https://github.com/user-attachments/assets/2a8a9eee-11c9-4143-b56c-3a2b4621af9a

This generalizes the tweaks from #11296, #17590, #35724, #37019, #37024,
#45160, #51659, #51973, #54546, #59775, and #62743, and supersedes
#62345 and #63983.

Important to note:
- This allows hyphenated words to break after the hyphen which is a
behavior change. I believe UAX #<!-- -->14 does permit tweaking this in
case we want to keep the current behavior, by filtering those out of the
`break_indices` return value.
- Obviously this isn't quite as performant as `is_word_char`, but it
seems to still be plenty fast enough, as I wasn't able to come up with a
contrived case where this causes noticeable performance issues.

## 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 text wrapping to follow Unicode line breaking rules.
- [GPUI] Improved text wrapping to follow Unicode line breaking rules.

---------

Co-authored-by: Noritada Kobayashi <noritada.kobayashi@gmail.com>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
2026-10-29 09:07:14 +00:00
Cole Miller 7f9a39a9c0 Bump livekit-rust-sdks to upgrade zip to 9.1 (#66272)
Bumps the `livekit`, `libwebrtc` and `webrtc-sys` git rev from `0a1c519`
to `fbda05e` (zed-industries/livekit-rust-sdks#15). The only change in
that rev is `webrtc-sys-build` moving from `zip` 0.6 to 9.1, using only
the pure-Rust deflate decoder. This clears these zip advisories:

- GHSA-m665-v7pm-7grj: inspection and extraction can see different
filenames.
- GHSA-vv5m-jxxh-4627: extraction keeps SUID/SGID bits.
- GHSA-4684-h2q9-2vcp: extraction can change permissions through a
symlink.

`zip` is used only at build time, to extract the prebuilt WebRTC
archive.

`Cargo.lock` changes:

- zip 0.6.6 → 9.1.3.
- Adds `nix`, `typed-path` and `zlib-rs`.
- Removes `bzip2`, `zstd` 0.11, `pbkdf2` and related crates that only
zip 0.6's default features used.

## Verification

- `corgi check -p livekit_client` passed. Corgi supplies WebRTC through
`LK_CUSTOM_WEBRTC`, so this check didn't use the download path.
- The download and extraction path was tested in
zed-industries/livekit-rust-sdks#15 against the real WebRTC archives for
macOS arm64 and Linux x64.

Release Notes:

- N/A
2026-10-29 03:35:38 +00:00
Finn Evers 02d47bf64f http_client: Unify asset downloading logic (#66048)
Supersedes https://github.com/zed-industries/zed/pull/62653

## Summary

This PR unifies the download handling we have in the http_client crate,
because we were alternating between the ways we were downloading a lot,
in one case we changed the way of downloading entirely if a hex digest
was present or not.

With this in, we now handle this one way for all kinds of downloads,
removing a lot of duplicated code and unifying the behavior here across
download types.

## Testing

Tested this manually.

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

- Improved reliability of language server and agent downloads by
verifying checksums consistently, rejecting failed HTTP responses, and
improving cleanup of partial downloads.
2026-10-28 21:52:54 +00:00
Anton Wiehe e5bdd01cd8 agent: Truncate long lines in read_file tool (#65395)
# Objective

Fixes #64376
Relates to #59401, #34099

Prevent the agent `read_file` tool from overflowing the model's context
window when encountering very long lines (such as minified
JavaScript/CSS, source maps, SVGs, single-line JSON files, or embedded
data URIs).

This follows up on the review discussion in #64378 with @smitbarmase to
implement generic line length capping rather than special-casing base64
strings.

## Solution

1. **Generic line truncation (`MAX_LINE_LEN = 2000`)**:
In `crates/agent/src/tools/read_file_tool.rs`, lines streamed in
`write_lines_numbered` are capped to 2000 characters
(`char_indices().nth(remaining)`), appending `... (line truncated to
2000 chars)`.
- Streaming chunks are tracked across boundaries so multi-chunk long
lines are capped without materializing oversized strings.
- Counts Unicode characters rather than bytes so multi-byte UTF-8 (e.g.
CJK) text is not cut early.
   - Preserves line numbers and trailing newlines intact.
2. **Updated tool description**:
- `read_file`: Informs the model that lines longer than 2000 characters
are truncated with `... (line truncated to 2000 chars)` and suggests
using `grep` or `terminal` to inspect the full content of very long
lines.
3. **Tests**:
- Added `test_write_lines_numbered_truncation` (unit test covering
single-chunk, multi-chunk, and multi-byte UTF-8 character capping).
   - Added `test_read_file_truncates_long_lines` (GPUI tool test).

## Testing

- Ran `cargo fmt -p agent --check` (clean).
- Ran `cargo test -p agent truncat` (all passed).

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments (none used)
- [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:

- Improved `read_file` tool output by truncating lines longer than 2000
characters to prevent context window overflow.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-10-28 18:01:40 +00:00
zed-zippy[bot] 66b6bbb6c8 Bump Zed to v1.28.0 (#66253)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-10-28 14:31:37 +00:00
Ben Brandt 5e8998a2a7 Update agent-client-protocol to 3.6.0 (schema 1.13) (#66245)
Updates `agent-client-protocol` to 3.6.0 (schema 1.13) and adopts the
protocol clarifications made since schema 1.12. Each commit stands
alone:

1. **Update agent-client-protocol to 3.6.0 (schema 1.13)**
- Adapts to the new types: tagged `AvailableCommand`,
`CancelledPermissionOutcome`, `ClientAuthCapabilities`, 1-based
`NonZeroU32` tool call lines, signed terminal exit codes, unsigned
`ResourceLink.size`, and v2 `RequestId` (no `null`).
- Terminal exit codes keep the platform's signed value instead of `c as
u32`; v1 Agents still receive the same 32-bit pattern as before.
- Session message participants follow the new patch rules: omitted
keeps, `null` clears, a value replaces.
   - An unknown tool status shows as in progress.
   - Unknown command kinds are offered as plain commands.
   - v1 `terminal/*` calls for an unknown terminal return `-32002`.
- A `terminal_update` with an invalid `output` snapshot still applies
its other fields (agentclientprotocol/agent-client-protocol#2577).
2. **Reject elicitation forms Zed can't render**: `-32602` for a
required property of an unknown type, a dangling `required` name, or
`enum` with `oneOf`. Optional unknown properties are left out, and
defaults that don't match their schema are ignored.
3. **Show streamed tool text as continuous text**: adjacent plain text
in `tool_call_content_chunk` extends the previous text block, like
message chunks.
4. **Apply tool call permission subjects to the transcript**: a
`tool_call` subject is applied like a `tool_call_update` before the
prompt is shown, so the permission card attaches to its tool call.

Related SDK and spec PRs: agentclientprotocol/rust-sdk#450,
agentclientprotocol/rust-sdk#451,
agentclientprotocol/agent-client-protocol#2578.

Release Notes:

- N/A
2026-10-28 12:48:20 +00:00
Ben Kunkle 24a2823456 gpui_wgpu: Fix WebGL surface reconfiguration panics (#66190)
## Summary

Advance wgpu from `3b3506e` to `cddb2f5` to adopt gfx-rs/wgpu#10348
(reported in gfx-rs/wgpu#10341). Keep the shader-validation Naga
dependency at the same revision. The lockfile changes only the sources
of the 13 wgpu-family packages; package versions and other dependency
selections are unchanged.

WebGL fence waits use a zero timeout because browsers do not support an
indefinite client wait. A fence can therefore legitimately time out
while GPU work is pending. The old surface reconfiguration path treats
that timeout as unreachable and traps; the upstream fix handles it
without weakening the native teardown behavior. This revision also
retains the Vulkan teardown fix that required the existing Git
dependency.

## Verification

- `cargo test --locked -p gpui_wgpu --lib valid_wgsl`: all three shader
validation tests pass.
- `cargo tree --locked -p gpui_wgpu --target all --depth 1`: runtime
wgpu and shader-validation Naga resolve to the same revision.
- Minimal real Chromium/SwiftShader Wasm reproduction: the original
dependency traps at `wgpu-core/src/instance.rs:884` during repeated
present/reconfigure operations; the fixed dependency completes all 20
iterations.
- Downstream optimized Wasm build and Chromium WebGPU/WebGL
start-and-resize smoke tests passed using this exact Zed branch commit.
- Negative control: forcing the old wgpu dependency in the same app
makes the retained WebGL smoke test fail; the browser trace starts with
the exact `instance.rs:884:25` / `wait_indefinitely() should never
timeout` panic. Restoring the fixed dependency makes both backend cases
pass again.

## Review status

Draft only; do not land automatically. The repository-required README
review marker is intentionally left for human removal. This branch
starts at the downstream consumer's existing Zed pin, so its eventual
dependency update need not include unrelated intervening changes.

Release Notes:

- [GPUI] Fixed WebGL surface reconfiguration panics when resizing while
GPU work is pending.

---------

Co-authored-by: Tom Houlé <tom@tomhoule.com>
2026-10-27 14:07:55 +00:00
Lukas Wirth dde76a1dca gpui: Some gpui cleanups (#66156)
## Summary

Some general reshuffling cleanups, more notable are the SubscriberSet
changes:

- Add a concrete `SingleSubscriberSet` for single-emitter observers,
removing the unnecessary outer map and emitter-key arguments.
- Keep `SubscriberSet` for observers grouped by entity or type.
- Replace separate activation and cancellation flags with one shared
`Pending | Active | Dropped` state, saving one `Rc` allocation per
subscription.
- Make `insert` immediately active and add `insert_pending` for deferred
activation, simplifying callers while preserving existing activation
timing.
- Preserve registration order and cancellation behavior when callbacks
add or drop subscriptions during dispatch. Merge retained subscriptions
with `BTreeMap::appen`d, avoiding rebuilding the tree when the
destination is empty.

Best reviewed commit by commit.

The first commit
[1740a07](https://github.com/zed-industries/zed/pull/66156/commits/1740a0718faddf57feb8cb0946a286585548ad3f)
re-orders the import / mod prelude a bit and gets rid of the lint allows
by fixing their offenses.

Release Notes:

- [GPUI] N/A
2026-10-27 10:26:02 +00:00
Max Brunsfeld e30095febc Update Tree-sitter and extension grammar memory imports (#66185)
This PR changes two things:

* Bumps the Tree-sitter dependency to include the grammar-loader commit
from [Tree-sitter PR
#6046](https://github.com/tree-sitter/tree-sitter/pull/6046).
- Update the extension builder to compile Zed extension grammars with an
explicit maximum size on their memory import. This makes it possible to
change the modules to work with a *shared* memory setting (needed for
multi-threaded parsing) on the Web, more efficiently. Shared memory
imports need an explicit max size, so this way we can change the import
to shared without having to move any bytes to make room for the max size
declaration.

Release Notes:

- N/A
2026-10-27 00:53:14 +00:00
Nick Dell'Osa 2c335b81dc Use tree-sitter-go fork (#64562)
# Objective

- Fixes https://github.com/zed-industries/zed/issues/62562
- [tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go) is not
being actively maintained. There have been 2 new versions of Go released
since the most recent commit to main, the most recent (Go 1.27) of which
introduced type parameters for methods, which majorly screws up syntax
highlighting in Zed at the present moment.

## Solution

- **zed-industries** should fork their own version of tree-sitter-go
like they have for
[tree-sitter-go-work](https://github.com/zed-industries/tree-sitter-go-work)
while we all wait for [this
change](https://github.com/tree-sitter/tree-sitter-go/pull/198) to get
merged into the upstream.
- Replace @yodalee's fork with the **zed-industries** fork, I'll update
this PR (or someone else can open one, I just want my syntax
highlighting 😅).

## Testing

- Built and ran this locally and can confirm it fixes the generic method
syntax highlighting issues.

## Self-Review Checklist:

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

## Showcase

#### Before
<img width="664" height="428" alt="Screenshot 2026-09-21 at 1 27 59 PM"
src="https://github.com/user-attachments/assets/16e38c94-769b-4991-9b69-87524c8467fb"
/>

#### After
<img width="634" height="440" alt="Screenshot 2026-09-21 at 1 28 59 PM"
src="https://github.com/user-attachments/assets/642a870e-4098-4552-b9d6-1fd3ee97d0e4"
/>

This is a throwaway example so you might think "What's the big deal?"
but I promise you our production code looks way worse without the fix.

---

Release Notes:

- go: add support for syntax highlighting for Go 1.27 generic methods.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-10-26 15:39:02 +00:00
Xin Zhao bd9aa0ac05 title_bar: Fix missing Git information for repository subfolders on Windows remotes (#66142)
## Summary

Fixed a bug where the title bar failed to show the Git repository,
worktree, and branch names when the opened folder was a subfolder of a
Git repository in a Windows remote project accessed from a Unix client.

The example below shows `vaspin` as the Git repository and
`vaspin/src/vaspin` as the opened folder:

|Local and Unix Remote|Windows remote before|Windows remote after|
|:--:| :--: | :--: |
|<img width="284" height="120" alt="image"
src="https://github.com/user-attachments/assets/0c499807-1399-434b-8154-a7fdcaa1087d"
/>|<img width="298" height="146" alt="image"
src="https://github.com/user-attachments/assets/0b9f716b-0ce2-4cf5-bfc0-e9d5e20f29ea"
/>|<img width="352" height="161" alt="image"
src="https://github.com/user-attachments/assets/7c7eb179-fec7-4dfd-bf6d-c288ac285e00"
/>|


## Testing

Tested locally; the comparison is shown above.

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

- Fixed missing Git repository, worktree, and branch names in the title
bar for Windows remote projects opened in a repository subfolder.
2026-10-26 13:51:27 +00:00
Kirill Bulatov 087340e2d7 Fix panic on cmd-q (#66158)
Closes https://github.com/zed-industries/zed/issues/57664

Updates `crash-context` transitive dependency (ergo the `patch` section)
to include https://github.com/rust-minidump/minidump-writer/pull/249
fix: given the latest release was a few months ago, decided to use the
git SHA pointer.

Release Notes:

- Fixed "Zed quit unexpectedly" when quitting via ⌘ + Q
2026-10-26 11:26:43 +00:00
Kirill Bulatov f14592c4a5 Require macOS 12 and SDK 26 (#65994)
Closes https://github.com/zed-industries/zed/issues/9307

Use SDK 26 and require newer macOS.
The latter allows to remove a few deprecated API usages.

Release Notes:

- [GPUI] BREAKING: bumped minimum macOS version to 12 (Monterey)
2026-10-26 11:20:07 +00:00
Kirill Bulatov 1808df02c0 Remove block dependency from the tree (#65942)
Closes https://github.com/zed-industries/zed/issues/22408

See also
https://github.com/zed-industries/scap/commit/b5c86ec58dd4b6b7732bf6ac8be03d6b1f190a82
that makes all macOS dependencies optional: we do not use these in Zed
anyway, and have `default-features = false` that allow to remove all
transitive `block` dependencies from the tree.

Adjust the test to ensure no such dependencies can appear later.

Release Notes:

- [GPUI] Removed `block` dependecy from the tree
2026-10-26 11:20:06 +00:00
Bennet Bo Fenner 91d3b962ae gpui_linux: Use the patched oo7 0.6 branch (#66035)
Use the Zed-maintained `oo7` 0.6 fork pinned to commit
`731c1215edb6905876c6137ab300428c7b8d7c13` for GPUI's Linux credential
backend. The commit is based on upstream `0.6.0` and returns
`Error::IO(UnexpectedEof)` when the Secret Service `Completed` signal
stream ends before yielding a message, instead of panicking.

## Validation

- `cargo check --locked -p gpui_linux` — passed.
- On the `oo7` `0.6` branch: `cargo check -p oo7 --lib` passed; `cargo
test -p oo7 --lib` passed (27 tests).

## Suggested .rules additions

- Treat `None` from D-Bus signal streams as stream termination and
handle it as an error rather than unwrapping.

Release Notes:

- [GPUI] Fixed a Linux keyring panic when the Secret Service prompt
stream ends unexpectedly.
2026-10-23 12:24:10 +00:00
Kirill Bulatov b36b283021 Do not read LLM credentials when disable_ai is true (#66029)
Closes https://github.com/zed-industries/zed/issues/65735

Release Notes:

- Fixed LLM credentials being read despite disable_ai being true
2026-10-23 10:32:56 +00:00
John D. Swanson 27ea42bf01 Update dependencies to address security vulnerabilities (#65997)
## Summary

Update locked dependencies to incorporate upstream security and
correctness fixes.

## Testing

- macOS arm64: Zed build passed; application launch confirmed.
- Focused dependency-consumer tests and optional QUIC compilation
passed.
- Formatting and diff whitespace checks passed.
- Linux and Windows were not tested locally.

## 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)
- [x] Tests cover the new or changed behavior.

Release Notes:

- Updated dependencies to address recent software ecosystem
vulnerabilities.
2026-10-23 08:37:00 +00:00
Ben Brandt fd2aedc471 agent_servers: Update ACP SDK to 3.5.0 (#65982)
Updates `agent-client-protocol` to
[v3.5.0](https://github.com/agentclientprotocol/rust-sdk/releases/tag/v3.5.0)
and adopts its fixes for v2 integration feedback.

- **Typed v1 fallback:** v2 startup uses `send_initialize`. A
`LowerVersion` outcome or a v1-only `-32022` error triggers the v1
fallback directly, instead of recovering the agent's response from the
debug log. The debug-log lookup is now only used when the agent exits
right after answering and the process-exit error supersedes the in-band
result.
- **Termination-aware disconnects:** connection-loss checks now include
`termination()` and `is_connection_terminated`, so transport or handler
failures (not only clean EOF) are treated as a lost connection.

Disconnect cleanup still uses `on_close` plus driver completion:
`finish_connection` already runs once the driver ends, and `on_close`
stays the ordered barrier for clean EOF.

Release Notes:

- N/A

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-10-22 12:25:18 +00:00
Kirill Bulatov 10cfb45944 gpui_macos: Migrate window and appearance bindings to objc2 (#65933)
Migrate window classes, callbacks, native geometry, ownership, and
appearance handling to objc2.

Remove the temporary legacy adapters and the now-unused objc and cocoa
dependencies.

Release Notes:

- [GPUI] Migrate macOS window and appearance bindings to objc2
2026-10-22 09:11:07 +00:00
John D. Swanson 130f1e92a4 Update dependencies to address security vulnerabilities (#65956)
## Summary

Update Zed's TLS certificate dependencies, managed Node runtime, and
Wasmtime stack to address the eMudhra intermediate compromise and recent
Wasmtime sandbox vulnerabilities.

- Update `rustls-webpki` to 0.103.16, `webpki-roots` to 1.0.10 and its
legacy wrapper to 0.26.11, and `webpki-root-certs` to 1.0.10. SQLx's
legacy wrapper resolves to the patched 1.0.10 root data.
- Update managed Node from 24.21.0 to 24.22.1.
- Update Wasmtime, WASI, and Tree-sitter's Wasmtime C API from 48.0.1 to
48.0.7, with aligned Cranelift 0.135.7 and required Wasm tooling
patches. Keep the existing Wasmtime feature set.

## Testing

Local platform: macOS arm64, Rust 1.98.1.

- `cargo build --locked -p zed --bin zed`: passed. Launched the new
binary with isolated user data and a temporary Rust file; the process
remained running. A user-provided screenshot confirms `app-smoke.rs`
opened and rendered with Rust syntax highlighting. Interactive GUI
checks were not completed: the UI automation tool failed to initialize
and macOS denied the Apple Events fallback. This PR remains a draft for
human review and any further manual validation.
- `ZED_HEADLESS=1 cargo test --locked -p extension_host -p node_runtime
-p reqwest_client --lib`: passed. The extension-host integration test
builds, installs, and runs the real test extension, including
relative/absolute filesystem operations and process execution.

```text
extension_host: 46 passed; 0 failed
node_runtime:   24 passed; 0 failed
reqwest_client:  4 passed; 0 failed
```

- `cargo check --locked -p extension_host -p extension_cli -p language`,
`./script/clippy --locked -p node_runtime -p reqwest_client`,
formatting, and diff whitespace checks passed. The lint wrapper's
optional cargo-shear/typos/buf checks were not run because cargo-shear
was unavailable.
- Isolated native aarch64 checks passed: oversized branch tables
rejected at 65,521 and 262,146 targets; a table at the supported 65,520
limit executes correctly; component instantiation and the pinned
Tree-sitter C API WasmStore work. WASI read/write/rename and internal
symlinks work with Zed's dual ReadWrite preopens; the trailing-slash
outside symlink rename and parent traversal are rejected without
modifying the outside sentinel.
- Isolated TLS checks passed: WebPKI 0.103.16 rejects all 12 captured
incident certificate chains with `CertDistrusted`, including when
supplied the old roots. The patched root bundles omit the affected root.
The official native Node archive matches its published SHA-256; Node
rejects all 12 incident hosts with `CERT_REVOKED` and accepts an
ordinary verified TLS control request.
- The standalone probes are local validation artifacts, not added
repository tests. Reviewers can rerun the Cargo commands above; for
manual validation, launch the build, open a source file, and install/run
a Wasm extension and a Wasm grammar. Linux/Windows runtime testing and a
full workspace test run were not performed. The debug app build emits a
large unwind-table linker warning and a future-compatibility warning for
`block`.

## Self-review

The dependency diff was reviewed for scope, version alignment, feature
changes, and sandbox compatibility. Two incidental dependency-link
changes selected by Cargo were removed; only the intended security
updates remain. README's review notice is retained because repository
rules reserve its removal for the human author.

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

## Suggested .rules additions

When checking a Cargo.lock update for scope, compare dependency lists
for packages whose own versions did not change; Cargo can reselect their
already-locked transitive versions.

Release Notes:

- Updated dependencies to address recent software ecosystem
vulnerabilities.
2026-10-22 04:43:07 +00:00
Anthony Eid b488c4e814 gpui: Update Taffy 0.13 to 0.15 (#65950)
Updates Taffy from 0.13 to 0.15. Upstream reports roughly 60% faster
grid layout and 15% faster flexbox layout, alongside layout caching
improvements and fixes to sizing, alignment, and absolute positioning.
This adapts GPUI to the updated measurement and alignment APIs while
retaining its explicit relative-positioning default; performance
improvements have not been benchmarked in Zed.

Validation: All 469 existing GPUI library tests passed with `corgi test
-p gpui --lib -F gpui_platform/runtime_shaders`; formatting and diff
checks passed. Runtime shaders were enabled to bypass a local Metal
compiler failure.

Release Notes:

- [Gpui] Update taffy version
2026-10-22 03:54:16 +00:00
Ryan Brue 42c4caa474 remote: Stop URL-encoding SSH usernames (#64744)
The username was percent-encoded when building the SSH destination, a
leftover from when the destination was an `ssh://` URL (#25314). Since
the destination is now passed as a plain argument, the encoding turned
domain usernames like `DOMAIN\user` into `DOMAIN%5Cuser`, and
authentication failed.

Pass the username verbatim instead. So that a username beginning with
`-` can't be parsed as an option, `ssh` now receives it via `-l
<username> -- <host>` rather than a `username@host` string, and
`scp`/`sftp` (which have no username option, and forward it to `ssh` via
`-l` themselves) get `--` before their operands. Options that used to
follow the destination (`-T`, and `-t` for the Windows master process)
are moved before `--` so they aren't sent as part of the remote command.

Fixes #63709
Closes #63722

Assisted-by: LLM

NOTE: This is a continuation of #63722. I chose to leave Shaik Shahid
Afridi as the primary author, because I'm just resolving the review
comments from that PR.

In responding to the review comments, we also improve SSH/SCP for
usernames starting with `-`, because we now use `-l` for SSH and `--`
for SFTP/SCP, though I'm not sure if OpenSSH would accept a username
starting with `-` anyways. Nevertheless, an improvement over what came
before.

# Objective

When attempting to connect to a remote with a backslash in the username
(or any other character that results in URL encoding), Zed would mangle
the resulting SSH command and the remote would not be usable.

## Solution

- Describe the solution used to achieve the objective above.
URL encoding in the SSH field is an artifact of when `ssh://` was used,
and is no longer needed.

## Testing

Tested by running Zed and attempting to connect to a remote with a
backslash in the user field (a Windows domain account). SSH succeeded,
but then I ran into a separate bug with `%PROCESSOR_ARCHITECTURE%` not
being expanded. I'll be looking into that in a separate PR.

```sh
2026-09-24T16:09:24-05:00 INFO  [remote::transport::ssh] Remote is windows: true
2026-09-24T16:09:38-05:00 ERROR [remote::transport] $SHELL is not set, falling back to cmd.exe
2026-09-24T16:09:38-05:00 INFO  [remote::transport::ssh] Remote shell discovered: cmd.exe
2026-09-24T16:09:39-05:00 ERROR [workspace::notifications] Prebuilt remote servers are not yet available for windows-%PROCESSOR_ARCHITECTURE%. See https://zed.dev/docs/remote-development
```

Tested on Linux x86_64, attempting to connect to a Windows x86_64
machine.

## Self-Review Checklist:

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

## Showcase

**NOTE:** I mentioned it above, but just in case it was missed, there is
a separate bug with Zed not expanding `%PROCESSOR_ARCHITECTURE%`. I'll
probably look into that next, since I'm trying to get remote development
set up for my Windows machine.


[Screencast_20260924_160804.webm](https://github.com/user-attachments/assets/ce6c77fb-eea5-4cda-944e-50539bece61d)

---

Release Notes:

- Fixed an issue where SSH usernames containing `/` or `\` were
percent-encoded, preventing successful connections.

Co-authored-by: Shaik Shahid Afridi <81465960+Yooosless@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-10-21 19:10:22 +00:00
Shuhei Kadowaki cb593458e1 project: Match document filter patterns in dynamic registrations (#65252)
## Summary

Follow-up to #59243, which made dynamically registered capabilities
honor the `language` and `scheme` of their document selectors, but left
`pattern` matching fail-open. A registration such as `{ "language":
"toml", "pattern": "**/Project.toml" }` therefore still applied to every
TOML document the server had opened, and a pattern-only filter applied
to every document.

This matches `pattern` against the document's path:

- String patterns are matched against the absolute path. As in the LSP
glob syntax, `*` and `?` do not match path separators.
- Relative patterns are matched against the path relative to their base
URI, and Zed now advertises the
`textDocument.filters.relativePatternSupport` client capability.
- Documents without a file system path never match a `pattern` filter.
Contexts that stand for a whole language, like the semantic token legend
lookup, and guest buffers whose path is unknown keep not evaluating
patterns.
- Registrations whose patterns are not valid globs are rejected when
they are registered.

LSP 3.18 changed `TextDocumentFilter.pattern` from a string to a
`GlobPattern`, so that it can also be a relative pattern. ~~This PR
depends on zed-industries/lsp-types#16, which updates the type and adds
the client capability. I'd like to merge this together with that
upstream change: `Cargo.toml` currently points at the commit of
zed-industries/lsp-types#16 on my fork, and I will switch it to the
`zed-industries/lsp-types` revision once that PR is merged.~~

**Update:** zed-industries/lsp-types#16 has been merged, and
`Cargo.toml` now points at its `zed-industries/lsp-types` revision
(zed-industries/lsp-types@82d7fc66eb).

## Testing

- Added unit tests for matching string patterns, wildcards across path
separators, and relative patterns.
- Added an integration test that a pattern-scoped completion
registration only applies to matching buffers, and that a registration
with an invalid pattern is rejected.
- Updated
`test_dynamic_formatting_registration_with_pattern_only_selector`, which
asserted the fail-open behavior left by #59243.

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

- Fixed language servers' dynamically registered capabilities applying
to files outside of the `pattern` of their document selector.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:41:09 +00:00
Kirill Bulatov cc23f35a7d Remove deleted files from file finder's history items (#65660)
Closes https://github.com/zed-industries/zed/issues/65657

Release Notes:

- Fixed deleted files from file finder's history items not being removed

Co-authored-by: Andrew Mitchell <alamottemitchell@gmail.com>
2026-10-21 15:34:53 +00:00