Commit Graph

40837 Commits

Author SHA1 Message Date
Parker Loflin d0400aaf03 gpui: Match keystrokes before context predicates (#66634)
## Summary

`Keymap::resolve_bindings_for_input` now matches keystrokes before
evaluating context predicates. Keystroke matching is cheaper and rejects
most bindings. Both checks are just pure filters so lookup results are
identical.

Avg time per `Keymap::bindings_for_input` call over 48 common keystrokes
in editor context. Windows 11 Ryzen 7 9800X3D.

| Keymap | Before | After |
|---|---|---|
| Linux | 15.5 µs | 1.26 µs |
| Linux + vim (normal mode) | 41.4 µs | 3.05 µs |
| Windows | 14.6 µs | 1.20 µs |
| Windows + vim (normal mode) | 41.5 µs | 2.97 µs |

## Testing

Windows 11, with and without vim mode: typing, `ctrl-s`, `ctrl-shift-p`
hints, `ctrl-k ctrl-c`, `ctrl-k z`, buffer search `enter` and `escape`,
and vim `i`, `escape`, `dd`, `gg`, `G`, `ciw`, `v d`. No issues found.

- `cargo test -p gpui --features test-support`: pass.
- `cargo test -p vim -p which_key`: pass.
- `cargo test -p zed -- keymap emacs keybinding`: pass.
- Lookup results match before and after for every bound keystroke
sequence and prefix, across 13 context stacks and the Linux, Windows,
and macOS keymaps, with and without vim.

## 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] Improved keybinding lookup performance.
2026-11-14 11:34:19 +00:00
Joshua Moon f0fa51bb51 gpui: Fix unused import warning with bench-support (#66905)
## Summary

Building gpui with `bench-support` alone without `test-support`, as
`cargo check -p gpui --features bench-support` and
script/gpui-bench-compare do, warns:

    warning: unused import: `DisplayId`
     --> crates/gpui/src/platform/test/platform.rs:7:32

Fix gates the import on `test-support`, like the neighboring imports
that are only used by `test-support` code.

#63039 added `bench-support` as a test dependency, and then #65059 added
the `DisplayId` imports without the same `#[cfg(...)]` its users have.

## Testing
Before

    # cargo check -p gpui --features bench-support
    [...]
    warning: unused import: `DisplayId`
     --> crates/gpui/src/platform/test/platform.rs:7:32
      |
7 | CursorStyle, DevicePixels, DisplayId, DummyKeyboardMapper,
ForegroundExecutor, Keymap,
      |                                ^^^^^^^^^
      |
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by
default
    
warning: `gpui` (lib) generated 1 warning (run `cargo fix --lib -p gpui`
to apply 1 suggestion)

After

    # cargo check -p gpui --features bench-support
    Checking gpui v0.2.2 (/home/josh/Source/zed/crates/gpui)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.14s

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

- [GPUI] N/A
2026-11-14 01:23:01 +00:00
Gregor Panek 5bd59e2e43 open_ai: Add GPT-6.1 Terra (#66659)
## Summary

Make GPT-6.1 Terra available for openai models


Release Notes:

- open_ai: Added support for GPT 6.1 Terra

---------

Co-authored-by: Anant Goel <anant@zed.dev>
2026-11-14 01:07:10 +00:00
Nikhil Sood 06999050d6 agent: Stream thread saves into zstd instead of buffering the JSON (#66683)
## Summary

Closes #65622

`ThreadsDatabase::save_thread_sync` serialized the whole thread into a
JSON `String` and then compressed it with `zstd::encode_all` into a
second buffer, so every save held the full uncompressed JSON and the
compressed output at the same time. For long threads with large tool
outputs that's tens of MB per save.

This change serializes through a `BufWriter` straight into a
`zstd::stream::Encoder`, so the uncompressed JSON is never held in
memory. The `BufWriter` is flushed explicitly so write errors propagate.
Serialization and compression now both happen before taking the database
lock (serialization already did), so the lock is only held for the
insert. The stored format is unchanged: same compression level, same
JSON including the flattened `version` field, so existing rows and the
load path are unaffected.

I measured it with a standalone program (not part of this PR) on a
synthetic thread with about 54 MB of JSON, 5 runs each:

| | extra peak heap during save | serialize + compress (median) |
| --- | --- | --- |
| before | 64.2 MiB | 42.6 ms |
| after | 0.23 MiB | 31.1 ms |

The synthetic data compresses very well, so on real threads the saving
is roughly the size of the uncompressed JSON per save. The `BufWriter`
matters: without it, streaming was about 2x slower than before because
`serde_json` makes many tiny writes.

Not in this PR: the save on scroll (`ui_scroll_position` and
`draft_prompt` are part of `DbThread`, so scrolling still triggers a
full save). That seems like a separate design question. I'm happy to
look at it as a follow-up. This change also doesn't touch save ordering.
Saves for a session still go through the save worker one at a time, and
#62698 is the separate fix for stale saves.

## Testing

- Added `test_save_thread_stores_versioned_json`, which saves a thread
with a long summary (quotes, backslashes, newlines, Unicode), reads the
raw row, decompresses it, checks the `version` field, and checks that
`DbThread::from_json` restores the same value. It guards the on-disk
format, so it passes before and after the change.
- `cargo test -p agent db::` (22 tests), `./script/clippy -p agent` and
`cargo fmt --check -p agent` pass. I ran these on Linux (arm64). I
haven't tested it manually in the app.

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

Release Notes:

- Improved memory usage when saving long agent threads.

Co-authored-by: Nikhil Sood <206686452+founderinaction@users.noreply.github.com>
2026-11-14 00:21:14 +00:00
Ben Kunkle dc93abce2f gpui: Keep macOS notification service calls off the UI thread (#66934)
## Problem

macOS notification APIs can synchronously wait for the notification
service, even when they expose completion handlers. A captured
main-thread stack showed notification dismissal blocked in
`removePendingNotificationRequestsWithIdentifiers:` →
`__NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__`. GPUI called
that API on the UI thread while holding its platform-state mutex,
freezing the interface until macOS replied.

## Changes

- Lazily start one dedicated notification thread that owns the
notification center, delegate, authorization state, and registered
categories.
- Queue posting and dismissal in FIFO order so a delayed dismissal
cannot overtake a replacement notification. Initialization and native
calls happen on the worker; notification responses still return through
the foreground executor.
- Return a `Task<()>` from `dismiss_system_notification`, allowing
callers to await completion without blocking the UI. Completion means
the platform calls returned, not that asynchronous OS work finished.
Dropping the task does not cancel dismissal. Update the other platform
implementations, example, and tests for the return type.
- Keep the unbundled-binary guard and use autorelease pools around
native work.

A stalled notification service can still delay later notification
commands, but no longer stalls the UI.

## Verification

Ran on macOS:

```sh
corgi test -p gpui -p gpui_macos --lib 'system_notification'
```

All five tests passed. The new regression test submits show/dismiss/show
commands without advancing a consumer, checks their order, and verifies
completion remains pending until acknowledgement.

The source published here is identical to that tested revision; the
subsequent commit only records the human removal of the README review
marker. No live macOS-service stall was induced, and
Linux/Windows/browser workflows were not run.

Release Notes:

- [GPUI] Fixed macOS system notification operations blocking the UI
thread while waiting for the notification service.

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-11-13 19:46:43 +00:00
Jakub Konka 83df5df635 Add corgi to the Nix dev shell (#66940)
Release Notes:

- N/A

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:11:44 +00:00
Anthony Eid aff99ecc32 gpui: Animate SVG transformations without re-rendering views (#66896)
## Summary

Ref #21146, #23479, #51597

One common problem that I've been working towards fixing by adding a
retained mode is Zed's high battery usage, caused by invalidating clean
entities because a single ancestor is dirty. While looking closer into
this problem I realized that a ton of the invalidations we run into are
due to animations, which can be fixed separately from retained mode.

My solution is adding a `TimedTransformation` struct and a new animation
API that uses it.

```rust
// A spinner: one full turn every two seconds.
svg()
    .path("icons/load_circle.svg")
    .with_timed_transformation(TimedTransformation::rotation(
        Duration::from_secs(2),
        Transformation::default(),
    ))

// A pulsing ring: grows to 1.5x while fading out, each value with its own easing.
svg()
    .path("icons/ring.svg")
    .with_timed_transformation(
        TimedTransformation::new(Duration::from_millis(1750))
            .from(Transformation::alpha(0.6))
            .to(Transformation::scale(size(1.5, 1.5)).with_alpha(0.))
            .with_scale_easing(Easing::EaseOutQuint),
    )
```

Because most of our animations are an SVG sprite with simple matrix
operations applied to it, such as rotation, alpha changes and size
changes, that change based on elapsed time, we can avoid invalidating
the view by extracting the before and after transformations and deriving
a function that takes elapsed time and computes what the animated sprite
should look like.

The extracted function lives in a table on the scene, and each animated
sprite points at its entry. This lets GPUI advance animations right
before presenting a frame, without dirtying the view or recomputing the
scene from scratch. This should save a lot of CPU usage and battery life
for end users of GPUI apps that use animations.

`Icon` and `Vector` in `ui` now use this for `with_rotate_animation`, so
Zed's existing spinners get it with no call site changes. With reduced
motion on, the SVG is drawn at its starting transformation and nothing
animates.

### Results

Main-thread CPU instructions for one animated frame, from a headless
benchmark on macOS with the Metal renderer (not included in this PR):

| | 200 animated SVGs | 60 rows of text + 5 spinners |
|---|---|---|
| Re-render with `with_animation` | 6.07 M | 7.34 M |
| `with_timed_transformation` | 162 K | 100 K |
| Improvement | 37x | 73x |

The `svg_animation` example (`cargo run --release -p gpui --example
svg_animation`, 200 animated SVGs in a window, Apple M4 Max), as
reported by `top`:

| | CPU | Energy impact |
|---|---|---|
| Re-render with `with_animation` | 21% | 21.5 |
| `with_timed_transformation` | 6% | 7.5 |
| `with_timed_transformation`, capped at 15 fps | 1.9% | 3.0 |

That is about 3.5x less CPU and 3x less energy impact uncapped, and
about 11x less CPU and 7x less energy impact with the cap.

### Follow ups

- Allow animating more primitives, such as glyphs, instead of only SVG
sprites
- Lower the fixed cost of presenting a frame, which is most of what
remains after this change
- Retained layers, so a whole subtree can be moved or faded without
re-rendering

Release Notes:

- Improved battery life by animating spinners without re-rendering the
views that contain them
- [GPUI] Added `TimedTransformation` and
`Svg::with_timed_transformation` to animate SVGs without re-rendering a
view
2026-11-13 16:33:49 +00:00
Fusora 563319c3f4 Sync Neovim default key mappings (#66759)
## Summary

Sync a few missing keymaps from Neovim.

## References

- https://neovim.io/doc/user/lsp/#gra
- https://neovim.io/doc/user/treesitter/#v_%5Dn

## 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 `g r t` keymap for `editor: go to type definition`.
- Added `] n` and `[ n` keymaps for `vim: select next/previous syntax
node`.
2026-11-13 16:24:06 +00:00
Danilo Leal 69239eb540 ui: Add an icon-only variant to the toggle button component (#66937)
We didn't support having a toggle button group component with just icons
in each button, but now we do :)

## 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
2026-11-13 15:12:37 +00:00
Bennet Bo Fenner faf97b0a0c Preserve structured model refusal details (#66929)
Carry provider refusal reasons, categories, and input/output stage with
refusal errors. Preserve unknown Gemini categories without interpreting
them.

Release Notes:

- N/A
2026-11-13 13:39:11 +00:00
Ben Brandt cb48e27ceb project: Prefer musl builds of ACP registry agents on musl Linux hosts (#66914)
The ACP registry now optionally publishes `linux-{arch}-musl` targets.
On a musl host (e.g. Alpine), Zed now picks that target and falls back
to `linux-{arch}` when an agent doesn't publish one.

The host libc is detected at runtime rather than with `cfg!(target_env =
"musl")`: the Linux remote server is a static musl binary that mostly
runs on glibc hosts, and the desktop build is glibc.

- Move the libc probe from the rust-analyzer adapter into
`util::libc_type::host_libc_type()` and cache the result for the process
lifetime.
- Also read `ldd --version` stderr, which is where musl prints its
version. Previously musl hosts were only detected through the `/lib`
scan.
- Use one ordered list of registry platform keys for both the "supported
on this platform" check and the archive selection, so the registry UI
and the installer agree.

Closes #66850

Release Notes:

- Improved ACP registry agent installation on musl-based Linux systems
to use musl builds when available
2026-11-13 12:27:17 +00:00
Jozef Porubcin af7a1adb50 Use full context window for Copilot models without long-context surcharge (#64302)
# Objective

- Some Copilot models support 1 million token context windows without
any surcharge, but Zed uses their smaller context windows by default.
For models where it's free to have more context, this PR uses them.
- Related to #54390 (Copilot path only), #58657 (Claude/Gemini yes,
GPT/Grok intentionally not), and #63123.

## Solution

- Bumped the API version used for Copilot Chat. The newer version of the
`/models` response reports per-tier token pricing
(`billing.token_prices`) with a `default` tier and an optional
`long_context` tier, each carrying its own `max_prompt_tokens`,
`input_price`, and `output_price`.

## Testing

Verified against the live `/models` endpoint by diffing both API
versions and applying the new `max_token_count` logic. Reproducible with
an authenticated `gh` (the Copilot `/models` endpoint accepts a `gh`
OAuth token directly):

```bash
TOKEN=$(gh auth token)
models() { curl -s -H "Authorization: Bearer $TOKEN" -H "X-GitHub-Api-Version: $1" \
  https://api.githubcopilot.com/models; }

# /models is non-deterministic — GitHub serves one of a few different model sets
# regardless of API version — so retry until both versions return the same IDs.
for _ in $(seq 1 20); do
  old=$(models 2025-10-01); new=$(models 2026-08-01)
  a=$(printf '%s' "$old" | jq -r '.data[].id' | sort)
  b=$(printf '%s' "$new" | jq -r '.data[].id' | sort)
  [ "$a" = "$b" ] && break
done
[ "$a" = "$b" ] || { echo "could not get matching model sets" >&2; exit 1; }

jq -s -r '
  (.[0].data | map({(.id): .capabilities.limits.max_context_window_tokens}) | add) as $old
  | .[1].data[]
  | select(.capabilities.limits.max_context_window_tokens != null)
  | .capabilities.limits as $lim
  | (.billing.token_prices // {}) as $tp
  | ($tp.default // {}) as $d
  | ($tp.long_context // null) as $lc
  | (($lc != null) and (($lc.input_price > $d.input_price) or ($lc.output_price > $d.output_price))) as $surcharged
  | (if $surcharged and (($d.max_prompt_tokens // 0) > 0)
       then [$d.max_prompt_tokens + ($lim.max_output_tokens // 0), $lim.max_context_window_tokens] | min
       else $lim.max_context_window_tokens end) as $new
  | [ .id, $old[.id], $lim.max_context_window_tokens, $new,
      (if $surcharged then "surcharged" elif $lc then "free" else "none" end),
      (if $new != $old[.id] then "CHANGED" else "" end) ] | @tsv
' <(printf '%s' "$old") <(printf '%s' "$new") \
| column -t -N 'MODEL,BEFORE,FULL_WINDOW,AFTER,LONG_CTX,'
```

Result (abridged; available models vary by Copilot plan):

```
MODEL                 BEFORE  FULL_WINDOW  AFTER     LONG_CTX
claude-opus-5         264000  1000000      1000000   free        CHANGED
claude-sonnet-5       264000  1000000      1000000   free        CHANGED
claude-fable-5.1      264000  1000000      1000000   free        CHANGED
claude-opus-4.8       264000  1000000      1000000   free        CHANGED
gemini-3.7-flash      264000  1000000      1000000   free        CHANGED
gemini-3.8-flash      265536  1048576      1048576   free        CHANGED
gpt-5.6-luna-utility  328000  1050000      1050000   none        CHANGED
gpt-5.4               400000  1050000      400000    surcharged
gpt-5.6-luna          328000  1050000      328000    surcharged
gpt-6-astra           400000  1178000      400000    surcharged
grok-4.6              328000  500000       328000    surcharged
gpt-4o                128000  128000       128000    none
```

Also ran `cargo test -p copilot_chat` and it passed.

## Self-Review Checklist:

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

---

Release Notes:

- Improved GitHub Copilot models to use their full context window when
the provider does not charge a long-context surcharge, and to display
per-token pricing where available.

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:10:26 +00:00
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
Joshua Moon 5a40bc8bd7 gpui_web: Fix safe-area insets under a strict style CSP (#66907)
## Summary

gpui web uses exploratory divs to learn about the unusable deadspace on
the margins of a device's screen, which it calls safe-area insets.

When doing this, it uses html `style` attributes with raw css
parameters. In modern web development, is typical to use a
`Content-Security-Policy` to block `unsafe-inline` css in html. This
feature breaks when such security settings are in use.

However, while raw CSS in the style element is not permitted, even with
the CSP set to block `unsafe-inline` style attributes, it still permits
some direct adjustments via CSSOM with `el.style.setProperty(p, v)`.
This workaround is already used by gpui web on the canvas and IME
elements.

See
*
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/style-src
*
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/style-src-attr

## Testing

I have manually reviewed this change in WebKit, Chromium, and Gecko. All
modern web engines support this workaround and document it as safe.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] There are no UI changes.
- [x] Tests are not relevant for this change.

Release Notes:

- [GPUI] Fixed safe-area insets reading as zero on pages with a strict
style Content-Security-Policy.
2026-11-13 11:33:53 +00:00
Smit Barmase 48741fd17d which_key: Show popup above open modals (#66838)
Follow-up to #66068

With which-key enabled, the popup didn't show while a modal was open,
like the commit editor or Go to Line. It was drawn as a modal, and the
modal layer holds only one.

It's now drawn in its own slot on `MultiWorkspace`, deferred above the
modal layer like the sidebar overlay. It doesn't take focus, so the
chord still completes in the open modal.

<img width="500"
src="https://github.com/user-attachments/assets/2089163d-e96b-4b5e-8d2d-0ca5d9826f63"
/>

Release Notes:

- Improved the which-key popup to also show inside open dialogs, like Go
to Line and the commit editor.
2026-11-13 05:28:29 +00:00
Smit Barmase 42fa909546 corgi: Support building on NixOS (#66827)
Building Zed with corgi on Linux fails because corgi hands webrtc-sys
and wasmtime-c-api-impl the macOS cmake and libwebrtc. Neither tool in
`corgi.toml` says which platform it's for, so corgi uses them
everywhere.

This gives both tools a `targets` list and adds Linux x86_64 builds of
each, same as Delta's `corgi.toml`.

It also forwards `PKG_CONFIG`, `PKG_CONFIG_PATH` and `CMAKE` from the
environment to the build scripts that need them. NixOS needs this
because build scripts run in a sandbox with no environment, so they
can't find pkg-config or the libraries from a Nix shell, and the
downloaded Linux cmake can't run there since it expects a standard
dynamic loader.

With this, Zed builds on NixOS as long as the shell sets
`CORGI_RUST_TOOLCHAIN`, `CORGI_CC` and `CORGI_NATIVE_RUNTIME_ROOTS`.

Nothing changes on a mac. I checked, and it picks the same tools and
rebuilds nothing, unless the shell already sets `PKG_CONFIG_PATH` or
`CMAKE`, in which case webrtc-sys and the crates that depend on it
rebuild once.

One thing still doesn't work out of the box. The Linux libwebrtc is a
zip, and corgi unpacks tools with `tar`, which GNU tar can't handle. I
use bsdtar as `tar` locally, but this probably wants a fix in corgi.

Left out on purpose:
- Linux arm64 tools.
- Zed's Nix dev shell. `nix develop` still doesn't include corgi or set
the `CORGI_*` variables, so for now you have to set those yourself.
- Non-Nix Linux like Ubuntu. Corgi needs every system library listed
under `[libraries]` there, and Zed doesn't list any yet.

Release Notes:

- N/A
2026-11-13 04:48:26 +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
John Tur 8e474e1598 gpui: Pass premultiplied alpha to wgpu shaders as a uniform (#66902)
We tried implementing this switch as a WGSL override constant to avoid
the uniform read. Only `blend_color` reads it, so most of our vertex
shaders don't use the constant. WebGPU specifies that unused constants
should be ignored. Safari 26 silently fails to build the pipeline
instead. So, put the flag back in the uniform.

Release Notes:

- N/A
- [GPUI] N/A
2026-11-12 21:45:07 +00:00
Ivan K. 73ad8e3ed0 Fix opening ssh:// links with a drive letter on Windows remotes (#66814)
## Summary

Closes #66813

`ssh://host/C:/project` (and `zed://ssh/host/C:/...`) sends
`/C:/project` to the remote, because a URL path keeps a `/` before a
Windows drive letter. A Windows remote server cannot canonicalize that
path (os error 123), so the project fails to open with
`DevServerProjectPathDoesNotExist`.

This is a follow-up to #66497, which fixed the same leading `/` for
local `file://` and `zed://file` links. That fix could not be reused
here: it checks the local OS while the URL is parsed, and for SSH the
remote's OS is only known after connecting. This change strips the slash
in `determine_paths_with_positions`, which runs after the connection and
can ask the remote for its path style. Paths on Unix remotes and `/~`
paths are left alone.

Before (Zed 1.27.0):

<img width="420" height="225" alt="zed-ssh-drive-letter-error"
src="https://github.com/user-attachments/assets/ee33b4e7-4dae-43a1-8bfa-8b85c8302ebe"
/>

After (this branch, same URL):

<img width="620" height="140" alt="zed-ssh-drive-letter-fixed"
src="https://github.com/user-attachments/assets/a937839c-f8ba-4f2e-9fb0-9ca1a91380be"
/>

## Testing

- Windows 11 Pro with OpenSSH Server, connected to itself over
`localhost` (setup in #66813).
- Zed 1.27.0: `zed
ssh://zed-win-repro/C:/Users/<user>/zed-ssh-repro/project` fails with
`DevServerProjectPathDoesNotExist path=/C:/...`.
- This branch, debug build, with the remote server built from the same
commit: the same URL opens the project, and the worktree is
`C:\Users\<user>\zed-ssh-repro\project`.
- `cargo test -p recent_projects --lib remote_connections`: 6 passed,
including the new `test_strip_slash_before_drive_letter`, which covers
both path styles and the paths that must stay unchanged.
- `cargo clippy -p recent_projects --tests`: no warnings.

To test a debug build against a Windows remote: the debug remote server
panics outside the checkout ("dev asset loading requires running from
within the checkout"), so build it with `cargo build -p remote_server
--features util/debug-embed` and set `ZED_COPY_REMOTE_SERVER` to
`target/debug/remote-server.exe`.

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

Release Notes:

- Fixed `ssh://` links with a drive letter (for example
`ssh://user@host/C:/project`) failing to open a project on a Windows
remote.
2026-11-12 21:00:35 +00:00
Eric Holk d3fc053d5b gpui: Speed up sorting scene primitives (#66898)
`Scene::finish` sorts each primitive array by draw order. It used
`sort_by_key` on the primitives themselves, so every move in the sort
copied a whole instance struct.

This sorts small `(key, index)` pairs instead, then permutes the
primitives in place by following the permutation's cycles, so each
primitive is copied once. Details:

- The insertion index is part of each key, so ties keep insertion order,
the same as the stable `sort_by_key` did. That also makes
`sort_unstable` safe to use, and it measured about 20% faster than the
stable sort here.
- Arrays that are already sorted return early without allocating.
- One key buffer, local to `finish`, is shared by all primitive kinds.
- Paths and surfaces keep `sort_by_key`: they aren't `Copy` and there
are few of them.

## Benchmarks

This adds a `Primitives/finish` group to the `primitives` bench. It
inserts the primitives during untimed setup and times only
`Scene::finish`. Measured on an Apple Silicon Mac, two seeds per size:

| Case | `main` | This PR | Change |
|---|---|---|---|
| random-256 | 6.0 / 7.2 µs | 4.0 / 4.4 µs | −33% / −40% |
| random-1024 | 46.0 / 40.7 µs | 22.9 / 18.4 µs | −50% / −55% |
| random-4096 | 270 / 264 µs | 121 / 117 µs | −55% / −55% |

The already-sorted patterns (grid, stripes, overlay and so on) take
0.1–4 µs and are the same or faster, apart from run-to-run noise in the
4096-primitive cases.

`finish` is about 5% of building a scene in
`Primitives/scene/random-4096` (about 5.5 ms per build), so the whole
scene build gets roughly 2.5–3% faster. Draw-order assignment during
insertion is the rest.

Release Notes:

- [GPUI] Improved the speed of sorting scene primitives in
`Scene::finish`

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

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 20:28:32 +00:00
Remco Smits 498af674ab fs: Improve responsiveness during heavy filesystem activity (#66835)
## Summary

While working on https://github.com/zed-industries/zed/discussions/66325
I noticed that everytime I boot Zed with `cargo run` it blocks the
background executor for **~5 seconds** while processing fs events from
`cargo check`. I noticed this via the following log that showed 2
things:

1. We block the background executor for ~5 seconds because we never
yield the dispatcher loop.
2. We have some overflow issues with `user dropped` errors, which i want
to look into next. Because we seem to over rescan when there is already
one in process (not 100% sure) but it looks like it.

**Before**

**Note**: I had to cap the logs, because the `rescan: user dropped` kept
showing up (over 400 times) until cargo check was done.

```
2026-11-06T17:51:19+01:00 INFO  [zed::reliability::hang_detection::logging] Background hang detected on Unknown:
Tasks(s) that ran too long
5.508914833s         - crates/fs/src/fs_watcher.rs:961:38

2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.config/zed/keymap.json"], recent_paths=["/path/to/zed/target/release/.fingerprint/dary_heap-5f373105b3bafcd8/lib-dary_heap.json", "/path/to/zed/target/release/.fingerprint/dary_heap-5f373105b3bafcd8/lib-dary_heap.json", "/path/to/zed/target/release/.fingerprint/dary_heap-5f373105b3bafcd8/lib-dary_heap.json", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta"]
2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.config/zed/settings.json"], recent_paths=["/path/to/zed/target/release/.fingerprint/dary_heap-5f373105b3bafcd8/lib-dary_heap.json", "/path/to/zed/target/release/.fingerprint/dary_heap-5f373105b3bafcd8/lib-dary_heap.json", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to.config/zed/keymap.json"]
2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/toLibrary/Application Support/Zed/extensions/installed"], recent_paths=["/path/to/zed/target/release/.fingerprint/dary_heap-5f373105b3bafcd8/lib-dary_heap.json", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json"]
2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/assets"], recent_paths=["/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed"]
2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/crates/grammars/src"], recent_paths=["/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed", "/path/to/zed/assets"]
2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.config/zed/themes"], recent_paths=["/path/to/zed/target/release/.fingerprint/gpui_util-b340aed9b9d177bb/invoked.timestamp", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src"]
2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.gitconfig"], recent_paths=["/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src", "/path/to.config/zed/themes"]
2026-11-06T17:56:24+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/toDocuments/code/zed"], recent_paths=["/path/to/zed/target/release/deps/rmeta5zTfxr", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to/zed/target/release/deps/rmeta5zTfxr/full.rmeta", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src", "/path/to.config/zed/themes", "/path/to.gitconfig"]
2026-11-06T17:56:25+01:00 INFO  [project::prettier_store] Prettier config file ".prettierrc" changed, reloading prettier instances for worktree 1
2026-11-06T17:56:30+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.config/zed/keymap.json"], recent_paths=["/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/rustcMLfajb", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/rustcMLfajb", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o"]
2026-11-06T17:56:30+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.config/zed/settings.json"], recent_paths=["/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/rustcMLfajb", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to.config/zed/keymap.json"]
2026-11-06T17:56:30+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/toLibrary/Application Support/Zed/extensions/installed"], recent_paths=["/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json"]
2026-11-06T17:56:30+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/assets"], recent_paths=["/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed"]
2026-11-06T17:56:30+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/crates/grammars/src"], recent_paths=["/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed", "/path/to/zed/assets"]
2026-11-06T17:56:30+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.config/zed/themes"], recent_paths=["/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.4iz1v46zr9aqlfexkegd6zykq.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src"]
2026-11-06T17:56:30+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to.gitconfig"], recent_paths=["/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to/zed/target/release/build/io-lifetimes-bd3d3f02c86a2171/build_script_build-bd3d3f02c86a2171.build_script_build.2a749c07dcaf763-cgu.0.rcgu.o", "/path/to.config/zed/keymap.json", "/path/to.config/zed/settings.json", "/path/toLibrary/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src", "/path/to.config/zed/themes"]
```

**After**

**Note**: It now only shows up a few times and the
`[zed::reliability::hang_detection::logging] Background hang detected on
Unknown: Tasks(s) that ran too long` message is gone :).

```
2026-11-11T13:57:30+01:00 INFO  [language] found user-installed language server for rust-analyzer. path: "/path/to/.rustup/toolchains/1.98.1-aarch64-apple-darwin/bin/rust-analyzer", arguments: []
2026-11-11T13:57:30+01:00 INFO  [lsp] starting language server process. binary path: "/path/to/.rustup/toolchains/1.98.1-aarch64-apple-darwin/bin/rust-analyzer", working directory: "/path/to/zed", args: []
2026-11-11T13:57:30+01:00 ERROR [crates/edit_prediction/src/edit_prediction.rs:2626] No organization selected.
2026-11-11T13:57:31+01:00 ERROR [crates/edit_prediction/src/edit_prediction.rs:2626] No organization selected.
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.config/zed/keymap.json"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/html_output_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/text_field_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/chooser_resource_loader.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/number_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/hidden_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/date_time_field_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h"]
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.config/zed/settings.json"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/text_field_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/chooser_resource_loader.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/number_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/hidden_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/date_time_field_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h", "/path/to/.config/zed/keymap.json"]
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/Library/Application Support/Zed/extensions/installed"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/chooser_resource_loader.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/number_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/hidden_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/date_time_field_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json"]
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/assets"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/chooser_resource_loader.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/number_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/hidden_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/date_time_field_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed"]
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/crates/grammars/src"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/number_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/hidden_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/date_time_field_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets"]
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.config/zed/themes"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/hidden_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/date_time_field_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src"]
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.gitconfig"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/date_time_field_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src", "/path/to/.config/zed/themes"]
2026-11-11T13:57:46+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/menu_list_inner_element.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/base_text_input_type.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/core/html/forms/form_data.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src", "/path/to/.config/zed/themes", "/path/to/.gitconfig"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.config/zed/keymap.json"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/plugins", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_change_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_type_converter.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_options.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/service_worker_global_scope_push.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_error.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.config/zed/settings.json"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_change_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_type_converter.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_options.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/service_worker_global_scope_push.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_error.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h", "/path/to/.config/zed/keymap.json"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/Library/Application Support/Zed/extensions/installed"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_change_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_type_converter.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_options.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/service_worker_global_scope_push.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_error.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/assets"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_type_converter.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_options.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/service_worker_global_scope_push.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_error.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed/crates/grammars/src"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_subscription_options.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/service_worker_global_scope_push.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_error.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.config/zed/themes"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/service_worker_global_scope_push.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_error.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/.gitconfig"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_error.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src", "/path/to/.config/zed/themes"]
2026-11-11T13:57:47+01:00 ERROR [fs::fs_watcher] Native filesystem watcher requested rescan: reason="rescan: user dropped", paths=["/path/to/zed"], recent_paths=["/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_event.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_message_data.h", "/path/to/zed/target/debug/build/webrtc-sys-fee0322722e0221f/out/webrtc-0001d84-4/mac-arm64-release/include/third_party/blink/renderer/modules/push_messaging/push_provider.h", "/path/to/.config/zed/keymap.json", "/path/to/.config/zed/settings.json", "/path/to/Library/Application Support/Zed/extensions/installed", "/path/to/zed/assets", "/path/to/zed/crates/grammars/src", "/path/to/.config/zed/themes", "/path/to/.gitconfig"]
2026-11-11T13:57:48+01:00 INFO  [project::prettier_store] Prettier config file ".prettierrc" changed, reloading prettier instances for worktree 1
2026-11-11T13:57:50+01:00 ERROR [crates/editor/src/editor.rs:3809] Get document highlights via rust-analyzer failed: content modified
2026-11-11T13:57:51+01:00 INFO  [project::prettier_store] Prettier config file ".prettierrc" changed, reloading prettier instances for worktree 1
2026-11-11T13:57:59+01:00 INFO  [zed::reliability] memory usage: resident 555 MiB (+446 MiB), virtual 521723 MiB
2026-11-11T13:57:59+01:00 INFO  [zed::reliability] worktree diagnostics: projects 1, orphaned projects 0, stores 1, slots 1, live 1, visible 1, strong 1, dead weak 0, loading 0, entries 5300, visible entries 5293, largest /path/to/zed (5300 entries, 5293 visible)
2026-11-11T13:58:59+01:00 INFO  [zed::reliability] memory usage: resident 640 MiB (+85 MiB), virtual 521821 MiB
2026-11-11T13:58:59+01:00 INFO  [zed::reliability] worktree diagnostics: projects 1, orphaned projects 0, stores 1, slots 1, live 1, visible 1, strong 1, dead weak 0, loading 0, entries 5952, visible entries 5293, largest /path/to/zed (5952 entries, 5293 visible)
```

**reviewer note**:
The only case that this change does not support/cover is coalescing
rescans across batches which is maybe a follow-up PR worth, but only if
we think it's a problem, but will leave that up to the reviewer.

## Testing

I add tests that validate that we still handle all events inside the
order as we expected. As you can see inside the **after** logs, the
background executor hang detector message is gone which showed up every
time consistently for me.

## 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 responsiveness during heavy filesystem activity, such as
external builds creating or removing many files.
2026-11-12 16:39:00 +00:00
Olivier Bonvalet 7fab4c0527 language_models: Detect OpenRouter Anthropic aliases (#66857)
## Summary

OpenRouter aliases are prefixed with `~` (e.g.
`~anthropic/claude-sonnet-latest`).
`into_open_router` only checked for the `anthropic/` prefix, so aliases
were
not treated as Anthropic models: no `cache_control` was sent (no prompt
caching), and `reasoning_details` was echoed back in requests.

Strip the leading `~` before checking the prefix.

Aliases are documented at
https://openrouter.ai/docs/guides/routing/routers/latest-resolution

## Testing

Added `test_anthropic_alias_model_uses_anthropic_request_handling`. It
fails
without the fix (`Alias should get cache_control`) and passes with it.
`cargo test -p language_models --lib open_router`, `cargo fmt --check`
and
`./script/clippy -p language_models` pass.

I did not test this manually against the OpenRouter API.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the checklist. (N/A, no UI change)
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed prompt caching for OpenRouter Anthropic aliases (e.g.
`~anthropic/...`)
2026-11-12 16:04:51 +00:00
HaukurPall 4dff6f8eef terminal: Route the remaining emulator access through the alacritty module (#66744)
## Summary

A follow-up to #57483. `terminal.rs` still reads a few things straight
from alacritty's `Term`: cursor blinking, colors the program set,
history size, the cursor line and the renderable cells. It also runs
vte's `Processor` itself. These now go through small functions in
`alacritty.rs`, so `terminal.rs` reaches the emulator only through that
module. Behaviour doesn't change.

This makes the emulator replaceable behind one module. Motivation:
#66743.

## Testing

- `cargo test -p terminal -p terminal_view`: 118 and 99 tests pass.
- `./script/clippy -p terminal` is clean.

## 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. (No behaviour change;
existing tests cover these paths.)

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

Release Notes:

- N/A

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 15:11:54 +00:00
Kirill Bulatov 3c846c3d49 Fix sidebar and no titlebar aligment (#66877)
Follow-up to https://github.com/zed-industries/zed/pull/65671

Make the vertical size of the tab bar and "Search threads" elements
aligned.

<img width="1728" height="51" alt="Screenshot 2026-11-12 at 12 34 07"
src="https://github.com/user-attachments/assets/8ce6294d-4392-440b-9b1d-9a99625124c1"
/>


Release Notes:

- N/A (Nightly only)
2026-11-12 15:02:44 +00:00
Kirill Bulatov eda58e5040 Keep history of unchanged tasks on tasks file updates (#66646)
Closes https://github.com/zed-industries/zed/issues/52659

Release Notes:

- Fixed task rerun opening task spawn menu after any tasks.json edit
2026-11-12 14:53:04 +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
Smit Barmase 6ceb6fee87 git_ui: Fix "entity released" errors when closing the branch picker early (#66873)
The branch picker detached the tasks that wait for the default branch
and remote URLs. If you closed the picker before they finished, they
tried to update it anyway and logged `entity released`. The picker now
owns those tasks, so they're dropped along with it.

<img width="600"
src="https://github.com/user-attachments/assets/2cff4aab-8476-4aa6-bd68-b1b3953fd163"
/>

Release Notes:

- N/A
2026-11-12 08:49:36 +00:00
John Tur 8a5cf7e23a gpui: Use Levien's shadow approximation (#66812)
GPUI draws shadows using Evan Wallace's technique: the blur along x is
computed in closed form with the error function, and the blur along y is
integrated numerically with four samples. Each pixel runs that loop,
which evaluates the error function eight times, plus four square roots
and four exponentials.

We replace it with [Raph Levien's closed-form
approximation](https://raphlinus.github.io/graphics/2020/04/21/blurred-rounded-rects.html)
of a blurred rounded rectangle. The blurred shape is approximated as a
superellipse whose radius and exponent are fitted to the blur, so each
pixel needs one distance and two error function evaluations. Everything
that depends only on the shadow is computed once per vertex and passed
to the fragment shader through interpolators.

The content in the `shadow` example differs from `main` by at most 5/255
per channel.

On an Intel HD 4600, GPU time in the `shadow` example is reduced by 30%
(2,008µs → 1,399µs).

Release Notes:
- Reduced GPU usage
- [GPUI] Improved shadow rendering performance
2026-11-12 08:19:32 +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 1d8eda94bd gpui: Improve primitive batching (#66810)
GPUI groups primitives into GPU batches by draw order. Each primitive is
inserted into an R-tree of the bounds painted so far, which assigns it a
draw order one above the highest order it overlaps. The renderer then
draws primitives in batches grouped by draw order, then by primitive
kind. We fix two limitations that split batches unnecessarily:

- Previously, a primitive that overlapped anything was assigned a new
draw order. However, GPUs draw instances in submission order, and within
a draw order we draw kinds in a fixed order. So, a primitive can share
the draw order of an overlapping primitive, as long as its kind doesn't
sort before the overlapped primitive's kind. (Sprites are exempted,
since sprites are also sorted by their atlas texture within a draw
order.)
- Note that adjacent batches of the same kind were already merged on
`main`, but any primitive of another kind drawn in between kept them
apart. Now, we reuse the draw order whenever it's safe.
- Previously, `window.paint_layer` created a new draw order from the
provided bounds as soon as the layer was opened. Now, the layer is
inserted into the R-tree once it's closed, using the union of the bounds
of the primitives painted inside the layer. It reuses a draw order by
the same rule, if every primitive in the layer could.
- Since `paint_layer` now computes its bounds from the primitives it
paints, the `bounds` argument is no longer needed and was removed.
Despite this, scene construction is still faster than it is on `main`.

In Zed, this cuts batches per frame from 20 to 4 at startup, and from 22
to 6 with a selection. On an Intel HD 4600, GPU time drops by 2.5–4.5%.

Release Notes:
- Reduced GPU usage
- [GPUI] Improved draw call batching. `Window::paint_layer` no longer
takes a `bounds` argument
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
John Tur caead827d7 gpui: Reduce redundant work in pixel shaders (#66807)
Our instance types are fairly large, and every pixel shader fetched its
whole instance. Since the vertex shaders read the same instance, pass
instance data along through interpolators, so the pixel shader can skip
the memory fetch in the common case. To balance the occupancy cost of
extra interpolators, we only pass what's needed to paint "simple"
primitives (e.g. solid, unbordered, unrounded quads); less common cases
fall back to a fetch in the pixel shader.

While we're here, work that's uniform across a primitive, like preparing
the gradient stops for a quad, now happens once in the vertex shader
instead of once per pixel.

This particularly helps devices with low throughput for storage buffer
reads, like the Snapdragon 8cx Gen 3. On the M4 Max, GPU time in the
`painting` example dropped by 15% (805 to 683µs). Discrete GPUs showed
negligible improvements.

Release notes:
- Reduced GPU usage
- [GPUI] Improved GPU rendering performance

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-11-12 08:19:29 +00:00
John Tur ba490197cf gpui: Manually clip primitive geometry (#66806)
GPUI previously implemented content masks with hardware clip distances.
This works, but has two downsides:
- Clip distances are vertex outputs, so they take up interpolator slots.
- WebGPU doesn't guarantee support for clip distances, so we could not
use them. Instead, primitives were clipped with a test in the fragment
shader instead, which entails large amounts of over-shading for clipped
primitives.

Content masks are always axis-aligned rectangles, and most primitives
can't be transformed. So, for those primitive types, we clip the
geometry manually in the vertex shader, which is trivial and avoids both
downsides.

Release Notes:
- Reduced GPU usage
- [GPUI] Improved performance of content masks

---------

Co-authored-by: Anthony <hello@anthonyeid.me>
2026-11-12 08:19:28 +00:00
Anthony Eid 78f5d7446c gpui_windows: Fix double borrow crash from display change handler (#66855)
Windows can deliver `WM_DISPLAYCHANGE` and `WM_MOVE` re-entrantly while
GPUI is already updating a window, so calling the display-changed
callback synchronously panicked with a double `RefCell` borrow. The
callback is now deferred to the foreground executor, matching how macOS
reports display changes.

Release Notes:

- windows: Fixed crashes that occurred when changing the display Zed's
window was located in
- [GPUI] Fixed double borrow crash from display changed handler on
Windows

Co-authored-by: Eric Holk <eric@zed.dev>
2026-11-12 01:31:03 +00:00
Finn Evers 3e23a0c482 Change the default settings value for file_finder.prefill_query_from_selection (#66856)
Closes https://github.com/zed-industries/zed/issues/66651

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

## Testing

Updated the existing tests.

## Self-review

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

Release Notes:

- Breaking: Changed the default value for the
`file_finder.prefill_query_from_selection` from `true` to `false`. If
you want to return to the previous behavior, toggle the setting at
[zed://settings/file_finder.prefill_query_from_selection](zed://settings/file_finder.prefill_query_from_selection)
2026-11-12 00:08:05 +00:00
Verlaire f99c53f4f6 Restore the last session when Zed is started by opening a path (#65463)
Closes #4848
Closes #57305

## Summary

On Windows and Linux, starting Zed by opening a file or folder (Explorer
"Open with Zed", a file manager, `zed <path>`) skipped session
restoration.
The new session then replaced the old one, so its windows, tabs and
unsaved buffers were lost.
macOS does not have that bug: there the request arrives after the
restore has started.

Now such a start first restores the local windows of the last session,
for at most 5 seconds, then handles the request with the same code as
before.
The request's window is created last, so it ends up in front.

- **A file opened without a CLI environment** (Explorer, a file manager,
the desktop entry) becomes a tab in its project's window, or in the
front window, as when Zed is already running.
  A file that has a saved window of its own reopens that window instead.
- **Any other path request** (a file from a terminal, a folder, `-n`,
`-a`, `-r`, `--diff`, `--dev-container`) opens in its own window, as
before.
A saved window with the same folders (a folder inside another one is
folded into it), or of the same repository, is left to the request and
kept out of the sidebar of the other restored windows.
- Remote requests, `zed://` links, channel links and `--wait` requests
are handled as before, without restoring.

Two changes in `workspace` come with it:

- A window restored by such a start can still be loading its tabs while
the user works in it or quits.
Until it has finished, saving it writes the layout it is restoring plus
a pane with what was opened in it meanwhile, and tabs opened in it are
kept when the saved tabs arrive.
  Every other restore takes the same code path as before.
- `Workspace::open_paths` returned the opened items sorted by path, not
in the order the paths were given, so several file links with positions
opened into one existing window could each get another file's line.
  Such a start now reaches that code, so it is fixed here.

Known limits:

- The requested path appears after the session's windows, at most 5
seconds later, and requests that arrive during startup wait for it.
- A saved window that has not opened within the 5 seconds is not
restored by this start; a bare `zed` in the same run restores it.
- A path start does not restore remote windows.
- A window still loading after the 5 seconds finishes behind the
request's window.
Until then its saved state wins over what is done in it: a saved unsaved
draft replaces newer text of the same file (typed, or saved to disk), a
bookmark or breakpoint removed from a saved row comes back, dock changes
are not saved, and `--wait` on a file among its saved tabs returns when
the saved tab takes its place.
A new tab whose id equals a saved tab's id replaces that tab in the
saved layout.

## Testing

50 new tests.
The startup tests run each kind of request against a saved session:
files joining a restored window (also file links with positions), files
and folders getting their own window with the CLI environment, `-n` and
`-r`, saved windows and sidebar projects left to the request (also
through a symlink, with a nested folder, and for a linked worktree),
remote windows, bare CLI, link and `--wait` requests, and the 5-second
limit ending in each phase.
The restore tests cover a window that is still loading: quitting keeps
its saved tabs, docks, bookmarks and breakpoints together with what was
added meanwhile; a tab opened in it survives, a file among the saved
tabs gets one tab, pinned tabs stay in place, the tab in use stays
selected; an ordinary start is unchanged.

Manual check:

1. Set `"restore_on_startup": "last_session"`.
2. Open a folder with two tabs and an untitled buffer with text, then
quit.
3. With Zed closed, open a file inside that folder from the file
manager: the folder window comes back with its tabs and the untitled
text, and the file is a new tab.
4. Quit and run `zed /another/folder` in a terminal: that folder is in
front and the first window is restored behind it.

## Self-review

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

Release Notes:

- Fixed opening a file or folder while Zed is closed not restoring the
last session on Windows and Linux, which caused previously open windows,
tabs and unsaved buffers to be lost.

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-11-12 00:02:18 +00:00
Kirill Bulatov b6ff193ba6 Stop showing worktree trust modal after "Stay in Restricted Mode" is called (#66649)
Closes https://github.com/zed-industries/zed/issues/58246

* Starts to remember "Stay in Restricted Mode" calls to avoid repeated
worktree trust pop-ups
* Uses `RemoteConnectionIdentity` instead of the prior type (removed) as
more detailed remote host identifier (has a port value now)
* Migrates worktree trust DB to that, more detailed, data format

Release Notes:

- Stopped showing worktree trust modal after "Stay in Restricted Mode"
is called
2026-11-11 21:17:08 +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
overcome ba06cc5191 Add setting to show/hide title bar (#65671)
## Summary

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

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

Includes macOS window-control handling adapted from #42540.

Related discussion: #55183.

## Testing

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

## Self-review

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

Release Notes:

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

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-11-11 19:41:02 +00:00
Sk Akram ec6a4a4b5e git: Fix both-deleted conflicts being parsed as both-added (#66648)
## Summary

Closes #66628

`FileStatus::from_bytes` parsed the `DD` porcelain status ("unmerged,
both deleted") as `Added`/`Added`, the same as `AA`. The wrong value
went into `StatusEntry::to_proto` and from there to collaborators and
the `project_repository_statuses` table.

`DD` now parses as `Deleted`/`Deleted`. No code reads these heads to
decide behavior: consumers match on `Unmerged { .. }` or pass the value
through proto and the database, so nothing depended on the old mapping
and there is no UI change.

## Testing

Added `test_parse_unmerged_status_codes` in `crates/git/src/status.rs`,
which checks all seven unmerged codes (`DD`, `AU`, `UD`, `UA`, `DU`,
`AA`, `UU`). Before the fix it fails on `DD`:

```
assertion `left == right` failed: DD
  left: Unmerged(UnmergedStatus { first_head: Added, second_head: Added })
 right: Unmerged(UnmergedStatus { first_head: Deleted, second_head: Deleted })
```

To confirm that git produces this status, I renamed one file to
different names on two branches and merged them. `git status
--porcelain=v1 -z` reported `DD original.txt`, along with `AU main.txt`
and `UA side.txt`.

Run on macOS:

- `cargo test -p git` (79 passed)
- `cargo test -p project --test integration git_store` (43 passed)
- `./script/clippy -p git`
- `cargo fmt -p git --check`

I did not test this in the running app, since the change has no visible
effect there.

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

Release Notes:

- N/A
2026-11-11 19:35:59 +00:00
Xin Zhao 43bd5d3cac Persist workspace PathStyle to database (#66465)
## Summary

This PR fixes how recent projects are displayed when a remote project is
on Windows and the Zed client is running on a Unix system. The buggy
example looks like this:
<img width="685" height="253" alt="recent_projects_modal_before"
src="https://github.com/user-attachments/assets/109d056e-908a-4003-9013-ebfecec75dc9"
/>

Again, this happens because we use a `std::path::Path` method to handle
Windows paths on a Unix system. To fix this, we need the `PathStyle`
associated with each workspace. However, recent projects have no live
workspace (they are loaded from the database), so there is no live
`PathStyle` we can query directly. The most direct way to get a reliable
`PathStyle` is to persist it in the workspace DB, so that when recent
projects are loaded from the DB, their `PathStyle` is loaded along with
them.

This PR adds a `path_style` field to `SerializedWorkspace` and a
`path_style TEXT` column to the `workspaces` table, so that `PathStyle`
is persisted to the DB. It also adds an `Option<PathStyle>` field to
`RecentWorkspace`, so that recent project paths can be handled reliably:
local workspaces always use the local path style, and remote rows saved
before this change (which have no stored value) fall back to it. The
actual fix is small: `highlights_for_path()` in
`crates/recent_projects/src/recent_projects.rs` now uses
`PathStyle::file_name(path)` instead of `Path::file_name()`, and its
callers are updated accordingly. For project groups in the current
window, the `PathStyle` is taken from a loaded workspace when available,
falling back to the persisted value otherwise. Since adding the new
column pushes some workspace queries past sqlez's 10-element tuple
limit, each `paths`/`paths_order` column pair is now read as a single
value through a small `PathListColumns` wrapper.

## Testing

New workspace DB tests cover persisting and loading `PathStyle`,
including missing and unrecognized values. The UI fix was tested
locally; see the screenshot below.

## 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 recent projects displaying incorrectly for Windows remote
projects when running Zed on macOS or Linux.
2026-11-11 19:08:35 +00:00
Mayank Verma 64ef8026c7 gpui: Resolve window placement from active window (#61459)
Closes #33314

### Objective

On multi-monitor setups, opening a new window placed it on the primary
display instead of the display I'm currently on.

### Solution

GPUI now retains the active window bounds and display ID while it is on
the update stack. New windows use this for placement, falling back to
the primary display when no active display is available.

### Testing

- Tested it on macOS 26

### Self-Review Checklist:

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

Release Notes:

- Fixed new windows always opening on the primary display
- [GPUI] Added `App::active_display`; `WindowBounds::centered` now takes
a `display_id`
2026-11-11 19:08:16 +00:00
Dino fdb60b8003 git_ui: Ensure check is right-aligned in repository selector (#66831)
## Summary

Update how the check icon for the selected repository is rendered in
`RepositorySelectorDeletage` in order for it to be right-aligned, just
like we already do in other pickers – `ThemeSelector`,
`IconThemeSelector`, `ModelSelector`, `LineEndingSelector`, etc.

However, I'm not entirely sure whether it's always best for the
checkmark to be right-aligned, as that might mean the user's eyes have
to scan more in order to find the currently selected item.

## Testing

Tested manually as shown in the screenshots below.

### Showcase

<details>
  <summary>Before</summary>

<img width="5312" height="3018" alt="CleanShot 2026-11-11 at 12 59
40@2x"
src="https://github.com/user-attachments/assets/8baae0be-7cd4-4d46-aa34-a2ee74f9f639"
/>
</details>

<details>
  <summary>After</summary>

<img width="5312" height="2970" alt="CleanShot 2026-11-11 at 12 53
14@2x"
src="https://github.com/user-attachments/assets/41ca7690-1221-4f0d-a097-71144635c906"
/>
</details>

## 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
2026-11-11 17:43:20 +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
pixelrick 5255d9c721 Do not probe LM Studio and llama.cpp at startup when disable_ai is true (#66842)
## Summary

When `disable_ai: true` is set, Zed still sent model-discovery HTTP
requests to local providers at startup: constructing
`LmStudioLanguageModelProvider` and `LlamaCppLanguageModelProvider`
kicked off an eager fetch to `http://localhost:1234/api/v0/models` and
`http://localhost:8080/v1/models` respectively, before any AI UI was
opened. #66029 gated credential reads behind `ai_disabled`, but these
discovery fetches read no credentials, so the probes kept firing.

This gates `restart_fetch_models_task` in both providers on the existing
`ai_disabled` helper, so no discovery request is made while AI is
disabled. The gate covers the eager construction-time fetch, restarts on
settings changes, and `refresh_models`, and clearing `fetch_model_task`
cancels any fetch that is in flight when AI gets disabled mid-run. Once
`disable_ai` is set to false, discovery resumes through the existing
flows (opening the agent panel or the provider's settings page).

Closes #66792

## Testing

- Added a regression test per provider
(`does_not_fetch_models_when_ai_is_disabled`): with `disable_ai: true`,
constructing the provider results in zero HTTP requests; after
re-enabling AI, restarting discovery fetches models normally.
- `cargo test -p language_models` - 132 passed, 0 failed (Linux).
- `./script/clippy -p language_models` - clean.

To verify manually: put a listener on the probed ports (`nc -lv 1234`
and `nc -lv 8080`), launch Zed with `"disable_ai": true` in settings,
and observe no connection is attempted at startup. Then set `disable_ai:
false`, open the agent panel, and discovery connects.

## 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). (This pr
makes no UI changes.)
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed LM Studio and llama.cpp model discovery requests being sent at
startup despite `disable_ai` being true
2026-11-11 17:22:55 +00:00
Arti 20f87a421d agent: Reject unknown fields in grep tool input (#66586)
## Summary

Local (or just flash/weaker) models at the end of the context might
miss-use the grep tool by passing a wrong name for `include_pattern`
parameter.

Grep tool just silently drops them and expands the search scope to the
whole project.

As a result you might end up with a surprise +900k tokens polluting the
context (from minified CSS and fonts files being one line) with no way
to get back to the step before the tool call

With this change the tool is supposed to explicitly fail when receiving
unknown parameter informing an agent what it did wrong and forcing it to
re-read the skill for the tool and try again instead of wasting the
context with irrelevant lines from svg and fonts.

Smarter models (that use the tool correctly in the first place) should
not be effected... theoretically... But in reality it might help them
too (I do not have money for expensive subscriptions to test bigger
models)


## Testing
Before:
<img width="821" height="979" alt="image"
src="https://github.com/user-attachments/assets/0df49d04-b566-40ea-885e-de5fe8a8734a"
/>

After:
<img width="785" height="976" alt="image"
src="https://github.com/user-attachments/assets/f304e0e9-861b-4148-8993-96e024bad187"
/>


## 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 some smaller models causing the agent to search the whole
project instead of a specific file or folder.
2026-11-11 16:53:58 +00:00
Cole Miller a19e19440d Add a backup Ubuntu package mirror in CI (#66841)
## Summary

Add the Clarkson Ubuntu mirror fallback used by Delta, restricted to
GitHub Actions. Append it to existing Namespace archive and security
mirror lists before installing Linux dependencies.

This intentionally does not rewrite direct source URLs. CI will test
whether the existing runner configuration is sufficient. Local developer
runs remain unchanged.

## Validation

- `bash -n script/linux`
- `git diff --check`
- Real-runner dependency installation is being checked by PR CI.

Release Notes:

- N/A
2026-11-11 16:08:47 +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
Finn Evers 82f2558e17 Stream directory check instead of joining all futures (#66830)
Refactors some code a bit I found during triaging - primarily changes
the is_dir check so that we stop on the first directory found as opposed
to awaiting all futures, then also get's rid of converting paths to
pathbufs to just then use them by ref again.

Release Notes:

- N/A

---------

Co-authored-by: tidely <43219534+tidely@users.noreply.github.com>
2026-11-11 13:44:34 +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