Commit Graph

40720 Commits

Author SHA1 Message Date
zed-zippy[bot] 5377f49c26 v1.28.x stable for @JosephTLyons v1.28.0 2026-11-11 15:20:26 +00:00
zed-zippy[bot] aeb8cba9a8 Fix document color inlays multiplying when switching render modes (#66732) (cherry-pick to preview) (#66776)
Cherry-pick of #66732 to preview

----
Closes https://github.com/zed-industries/zed/issues/57600



https://github.com/user-attachments/assets/bd11e708-0e6b-487a-9501-81de918866b3

Release Notes:

- Fixed document color inlays multiplying when switching render modes

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-11-10 09:02:47 +00:00
zed-zippy[bot] 1e31ceb4a6 tasks_ui: Fix tasks with file variables missing for single-file worktrees (#66195) (cherry-pick to preview) (#66751)
Cherry-pick of #66195 to preview

----
## Summary

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

This PR:

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

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

Closes #66148

## Testing

- Added `test_single_file_worktree_provides_file_context`: the item
context of a single-file editor contains `ZED_FILE`, has no
`ZED_WORKTREE_ROOT` and no `cwd`.
- Added tests that spawn a worktree-local task by name, or rerun it with
`reevaluate_context: true`, while a file-backed external editor is
active (single-file and invisible directory worktrees): the task
resolves against its own worktree and doesn't get the external file's
`ZED_FILENAME`.
- Added

`test_spawn_by_name_resolves_global_task_with_global_tasks_file_editor_active`:
with a file-backed global `tasks.json` editor from an invisible worktree
active, a global task gets the visible project's root and cwd, keeps
`ZED_FILENAME` and has no `ZED_RELATIVE_FILE`.
- Added

`test_spawn_by_name_resolves_global_task_with_single_file_worktree_listed_first`:
the same check with a visible single-file worktree listed before the
visible directory worktree.
- Extended
`test_external_item_context_does_not_carry_its_worktree_environment`: an
external item's `ZED_MAIN_GIT_WORKTREE` and language-provided variables
don't reach global tasks.
- Added

`test_spawn_by_name_does_not_use_language_targets_derived_from_external_relative_path`:
with the built-in languages registered and a Python file from an
invisible worktree active, the real `PythonContextProvider` derives a
relative `ZED_CUSTOM_PYTHON_TEST_TARGET` for the editor, but a global
`pytest` task spawned by name gets the `.` default and the visible
project's cwd.
- `cargo test -p tasks_ui` and task-related tests in `project` pass.
- Manually reproduced on Linux before the fix: with global tasks using
`$ZED_FILE` and a task without variables, only the latter was listed for
a file opened via `ctrl-o`, while both were listed with a folder opened.
- Manually verified on Linux after the fix: global tasks using
`$ZED_FILE` are listed and run for a file opened via `ctrl-o`.
- `./script/clippy` passes.

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

## Self-review

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

Release Notes:

- Fixed tasks that use file variables such as `$ZED_FILE` not being
listed in `task: spawn` when a single file is opened without a folder.

Co-authored-by: Aliaksandr Zhyburtovich <graduss@tut.by>
2026-11-09 16:10:18 +00:00
zed-zippy[bot] 62e797e4b4 remote: Retry the POSIX environment probe without stdin (#66737) (cherry-pick to preview) (#66741)
Cherry-pick of #66737 to preview

----
Closes https://github.com/zed-industries/zed/issues/66587
Follow-up to https://github.com/zed-industries/zed/pull/66097

Release Notes:

- Fixed SSH connections failing with "Missing remote shell" when the
remote shell's startup reads from stdin

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-11-09 11:35:42 +00:00
zed-zippy[bot] f35ab74cbb gpui_macos: Handle unavailable pasteboards (#66736) (cherry-pick to preview) (#66739)
Cherry-pick of #66736 to preview

----
Closes https://github.com/zed-industries/zed/issues/66694
Follow-up to https://github.com/zed-industries/zed/pull/65713

Restores the objc1 behavior that handled `nil` case.

Release Notes:

- Fixed SSH connections to macOS hosts getting stuck on "Starting Proxy"
when the remote server cannot access the system pasteboard
- [GPUI] Fixed a crash when macOS fails to provide the general or find
pasteboard

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-11-09 11:31:28 +00:00
zed-zippy[bot] 8e1ba5b4e0 v1.28.x preview for @JosephTLyons v1.28.0-pre 2026-11-04 15:12:38 +00:00
Xin Zhao 784374c679 remote: Fix Windows SSH commands when the default shell is Nushell (#65580)
## Summary

Closes #65575

When connecting over SSH to a Windows remote server, Zed forwards
commands that need to be executed (for example terminals and tasks)
through `ssh`. The logic lives in `build_command_windows()` in
`crates/remote/src/transport/ssh.rs`. The command built on the client
looks like this:

```
ssh -t <remote_server> powershell -E <command_base64>
```

Zed passes `powershell -E <command_base64>` to `ssh` as the remote
command. The Windows OpenSSH server appends it as-is to
`<ssh_remote_shell> <shell_command_option>`, so the command that
actually runs on the remote server is:

```
<ssh_remote_shell> <shell_command_option> powershell -E <command_base64>
```

For `cmd.exe`, which is the default Windows OpenSSH server shell, the
final command is:

```
cmd.exe /c powershell -E <command_base64>
```

This works fine. However, if the default shell is changed to `nu`, the
final command becomes:

```
nu -c powershell -E <command_base64>
```

Here `nu` treats `powershell` as the only command to execute and passes
`-E <command_base64>` to itself as flags. `-E` is not a flag of `nu`, so
we get the following error:

```
The nu command doesn't have the flag '-E'
```

To fix this, the command is now wrapped in literal quotes when it is
sent, so that the command line executed on the remote server becomes:

```
<ssh_remote_shell> <shell_command_option> "powershell -E <command_base64>"
```

This way, `powershell -E <command_base64>` is always interpreted as a
single command, regardless of the shell.

## Testing

I checked the process creation on the Windows remote with Procmon:

- Before the change, `nu` was launched as `nu -c powershell -E
<command_base64>`.
- After the change, it is launched as `nu -c "powershell -E
<command_base64>"`, which runs successfully.

I also manually tested `nu`, `pwsh`, `powershell`, and `cmd` as the
Windows OpenSSH server default shell. Terminals and tasks work correctly
with all of them.

## Self-review

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

Release Notes:

- Fixed the remote terminal and tasks failing on Windows SSH servers
whose default shell is Nushell
2026-11-04 14:08:18 +00:00
Smit Barmase 3c4f6d6e90 openai_subscribed: Preserve cached prefix during compaction (#66527)
Follow-up to #64938
Part of #59528

ChatGPT subscription models now use `PreserveRequestPrefix`, so
prompt-based compaction keeps the tool definitions and sends
`tool_choice: none` instead of rebuilding the prompt, which keeps the
cached prefix.

These models already support `tool_choice: none` and go through the same
Responses request conversion as the OpenAI provider, where OpenAI
[recommends this
approach](https://developers.openai.com/api/docs/guides/prompt-caching#manage-tools-with-append-only-updates).

Tested with GPT-6.1-Sol: `/compact` went from 0 cached input tokens to
16,128 of 16,361.

Release Notes:

- Fixed compaction not reusing the prompt cache for ChatGPT subscription
models.
2026-11-04 14:02:53 +00:00
Michele C. Soccio 9fa6fd3f44 Worktree picker: search also by branch name (#66384)
## Summary

In the worktree picker, can now search by both branch and worktree name
instead of only by worktree name.

With the current implementation whenever the worktree and a checked out
branch do not share same name and the user wants to switch worktree,
they have to remember the worktree name, or do some workaround like
launching `zed .` from the worktree. It's not possible to switch
worktree using the branch picker, as it will try to check out the branch
in the current worktree (this change doesn't touch that behaviour).

An example where it exists a branch named `a-random-branch` checked out
in worktree `zed-deliberate-purpose`

Before, when searching by `random` the worktree does not appear:

<img width="696" height="197" alt="image"
src="https://github.com/user-attachments/assets/cd1674c1-3ca6-4337-ad16-439f58df9e03"
/>

After, it is fuzzy matched because of the branch name:

<img width="668" height="189" alt="image"
src="https://github.com/user-attachments/assets/ed521e76-bc1b-4e4e-b662-7caba46ff91a"
/>

## Testing

I manually tested the change, but only on macOS. I have been using it
for a few weeks with megarepos and tens of worktrees/branches.

## 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 the possibility to search also by branch name in the worktree
picker.
2026-11-04 14:02:39 +00:00
tidely ead5672e16 agent: Fix compaction being billed as un-cached input tokens (#64938)
## Summary

Compaction currently bills the entire context window as input tokens
instead of cached input tokens, because tool definitions change during
compaction requests. Compaction here is separate from native provider
compaction.

Closes #59528

The fix is only able to be applied to providers which have a way of
disabling tools without changing the tool definitions. This notably does
not include Anthropic.

This PR adds a compaction strategy enum, which describes whether a
provider supports disabling tools without causing a cache miss. The new
variant checks whether the model supports `tool_choice: none` and
includes it in the request, while keeping the tool definitions the same.

A provider may support `tool_choice: none`, but still bust the cache, or
have models which don't support it. So we need both the enum and
`tool_choice: none` check.

## Testing

I've added tests for checking request prefix equality during compaction,
where this new fix is applied.

## 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 compaction being billed as un-cached input tokens
2026-11-04 13:36:23 +00:00
Dino ad54befbc6 workspace: Ensure panel is activate before opening dock (#66472)
## Summary

When handling a `PanelEvent::Activate` event, the dock where the panel
lives was being opened before the panel from which the event was emitted
had been activated. This ends up calling the `Panel::set_activate`
method for whatever panel was active on the dock before the event was
handled, which could lead to weird cases where the panel from which the
`PanelEvent::Activate` event was emitted ended up having its focus
stolen by another panel.

For example, if the dock's previous active panel was the terminal panel,
calling `Panel::set_activate` would start spawning a terminal session
which could finish loading after the new panel had been activated and
would end up stealing the focus back to itself.

Closes #66197

## Testing

Besides manually testing this, as shown in the screen recordings below,
a test was added to ensure this behavior was fixed when handling the
`PanelEvent::Activate` event but, in order for us to be able to assert
whether a panel's `set_active` method was called,
`TestPanel::activation_history` was introduced.

### Showcase

<details>
  <summary>Before</summary>


https://github.com/user-attachments/assets/1762362f-65fc-49ae-b7ed-9b925e179710


</details>

<details>
  <summary>After</summary>


https://github.com/user-attachments/assets/163b410e-13dd-4f07-8371-01b48f7e3076


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

- Fixed an issue where using `pane: reveal in project panel` after
closing the last terminal tab would unexpectedly reopen the terminal
panel
2026-11-04 11:11:39 +00:00
Finn Evers 8a41a5cc04 crates_io_client: Add GitHub Trusted Publishing configuration endpoints (#66473)
As a next step, this PR adds the trusted publishing endpoints to the
crates.io API client.

Also slightly improves our pagination handling for crates.

Release Notes:

- N/A
2026-11-04 09:13:14 +00:00
Piotr Osiewicz ba36af2050 Revert "Reduce waits for navigation, suggestions, and file comparisons (#66487)" (#66517)
This reverts commit 7e7311ad20.

Defer this change until after the release so it has time to bake rather
than landing immediately before it.


## Summary

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

## Testing

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

## Self-review

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

Release Notes:

- N/A

Co-authored-by: Amp <amp@ampcode.com>
2026-11-04 08:38:40 +00:00
morgankrey dd34370114 Add organization management permission and follow organization changes after account reloads (#66494)
This PR does two things for organizations in Zed Cloud:

1. It adds one yes/no value, `can_manage_organization`, to the
organization data that Zed and Delta receive from Cloud. It is true when
the signed-in user is an owner or admin of that organization.
2. It fixes Zed so that, when the user loses access to their selected
organization, AI features and edit predictions switch to the new
organization right away instead of after a restart.

## Why

**The new value.** Delta will show a "Manage Organization" link, which
opens the organization's page in the dashboard, only to owners and
admins of a team organization. Cloud now sends this value
([zed-industries/cloud#4489](https://github.com/zed-industries/cloud/pull/4489)).
Delta reads Cloud's account data through `cloud_api_types`, so the crate
must describe the new value first.

**The fix.** The same Cloud change makes Cloud send a "user updated"
message when someone's role changes, when they are removed from an
organization, when they accept an invitation, or when they create an
organization in the dashboard. Zed already reloads the user's
organizations when that message arrives. Before, Cloud never sent it for
these changes, so Zed did not notice them until a restart.

Now Zed notices, but one step was missing. If the user was removed from
their selected organization, the reload selects a different
organization. It did not send Zed's "organization changed" signal. That
signal is what makes Zed get a new AI token for the selected
organization. Without it, AI features and edit predictions kept using
the old organization until the token expired or Zed restarted.

## What changed

- `cloud_api_types`: `OrganizationUiPermissions` gets
`can_manage_organization`, next to the existing
`can_install_github_app`. It is true for owners and admins, and false
for billing managers and members. It is also true for the owner of a
personal organization. Zed does not read it.
- `client`: `UserStore::update_authenticated_user` now emits
`Event::OrganizationChanged` when a reload replaces the selected
organization. The first load after sign-in does not emit it, as before.

## Data impact

- The new field defaults to false when the server does not send it, so
older servers and older clients keep working.
- After a removal, Zed now requests one new AI token for the newly
selected organization. Nothing else changes when the selected
organization stays the same.

## Limits

- When "user updated" arrives, Zed also starts an AI token refresh for
the organization that is selected at that moment. If the user was just
removed from it, that one request fails and Zed logs an error. The token
refresh triggered by the new signal then succeeds.

## Testing

- `cargo test -p client --lib`: 23 passed. The new test reloads the
account twice: an unchanged reload sends no signal, and a reload after
removal sends exactly one and selects the remaining organization. It
failed before the fix.
- `./script/clippy -p client`: clean.
- `cargo test -p cloud_api_types`: 13 passed.

Release Notes:

- Fixed AI features and edit predictions continuing to use an
organization after you were removed from it.
2026-11-03 22:49:20 +00:00
morgankrey 7e7311ad20 Reduce waits for navigation, suggestions, and file comparisons (#66487)
# Objective

Reduce waiting when navigating code, loading details for code
suggestions, and comparing files. Zed currently starts some independent
file reads and requests only after the previous one finishes.

## Solution

- Load up to 16 definition or reference results at once. Keep their
original order. Repeated results for the same file share one read and
one open copy of the file.
- Request details for up to 16 code suggestions at once. Repeated item
indexes produce one request. Successful items still update if one
request fails. Keep the checks that each language server supports the
request.
- Read both sides of a file comparison together. Load up to 16
comparison pairs at once, while keeping their display order.
- Add controlled-delay tests. Saved file contents and the text ranges
returned by navigation stay the same.

## Testing

On current `main` at `8a47b35109`:

- 748 tests passed across `project`, `git_ui`, and `git_ui_core`. Four
tests were already ignored. Each suite ran one test at a time.
- Seven timing and behavior tests passed across 100 task execution
orders each: 700 runs. They check result order, repeated files and
suggestions, the request limit, errors, and cleanup.
- Required `./script/clippy` passed for all three packages, with all
targets and all features. Its dependency check also passed. The check
used no debug symbols and `profile.release.opt-level=0` to limit build
storage.
- Formatting and `git diff --check` passed.

The original checkout measured the following controlled delays. The port
to current `main` passes the same 40 ms checks:

| Operation | Before | After |
| --- | ---: | ---: |
| Go to definition across three unopened files | 120 ms | 40 ms |
| Find references across three unopened files | 120 ms | 40 ms |
| Load details for three code suggestions | 120 ms | 40 ms |
| Open one file comparison | 80 ms | 40 ms |
| Open three file comparisons | 240 ms | 40 ms |

Each independent read or request has a deliberate 40 ms delay. These
results prove reduced waiting in these cases. They do not establish a
whole-application speed improvement. Remote network performance and the
best concurrency limit for each machine remain unmeasured.

The earlier checkout also passed all five checks in a clean-built macOS
app. Those built-app checks predate this port. They are separate from
the current-main checks above.

Reviewers can run the focused tests with:

```sh
ITERATIONS=100 cargo test -p project -p git_ui -p git_ui_core --features project/test-support concurrently -- --nocapture
```

## Self-Review Checklist

- [x] Reviewed the changes for correctness and cleanup of completed or
failed work
- [x] Added tests for the changed behavior and measured waiting time
- [x] Kept result order and bounded active work

## Suggested .rules additions

Proposed text for the project test guidance, for review in a separate
rules change:

> In GPUI tests that check the release of invisible worktrees, drop the
final buffer handles inside `cx.update(...)`, then check the remaining
worktrees. `run_until_parked()` alone does not flush deferred entity
releases.

Release Notes:

- Improved responsiveness when navigating code, loading completion
details, and comparing files.
2026-11-03 22:41:41 +00:00
Young Seo Kim b7a6e5cdc0 call_hierarchy: Add gap between call hierarchy name and detail (#66144)
## Summary

Closes #64379

### 1: Space between signature and detail

Add `gap_1` in `render_match`.  

Before:
<img width="908" height="115" alt="Screenshot 2026-10-26 at 5 39 36 PM"
src="https://github.com/user-attachments/assets/f4d7d582-dd0c-459d-85c8-24744e463f10"
/>

after:
<img width="596" height="119" alt="Screenshot 2026-10-26 at 5 40 09 PM"
src="https://github.com/user-attachments/assets/9d863061-8246-40a0-b8f7-5660db91fdf6"
/>

### 2: Showing detail in tooltip + bug where tooltip would not show

needs_tooltip was computed from the width of the label text alone (e.g.
func helper), ignoring the separate detail (the package path). So even
when the rendered row (func helper path/to/go/repo/package) was wider
than the modal, the tooltip was never attached.

Fixes: 
- Width measurement: when the label doesn’t already contain the detail,
measure label + detail instead of just the label.
- Tooltip content: pass the detail into CallSignatureTooltip and render
it when the label doesn’t already contain it. Complete signature labels
(e.g. Rust’s fn helper(&self) -> i32) already include the detail, so it
isn’t appended twice.

Go example: 
<img width="1232" height="344" alt="image"
src="https://github.com/user-attachments/assets/a648054b-19eb-44d6-b465-315ccf14af44"
/>

Rust example:
<img width="733" height="142" alt="Screenshot 2026-10-26 at 11 59 51 PM"
src="https://github.com/user-attachments/assets/b854dd54-ce1f-4ef1-9849-bc6c5ae8413d"
/>

Tooltip now correctly shows on hover and includes detail while not
duplicating in the case the label already has it.


## Testing

all tests in `call_hierarchy` pass and I've added two tests:
- Added a regression test that the tooltip appends the separate detail
for name-only labels (e.g. Go package paths).
- Added a regression test that a complete signature label (e.g. Rust)
does not get its detail appended twice.

## 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 call hierarchy item details: added spacing between the name
and detail, and fixed the hover tooltip to show the full detail
(including package paths) when the row is truncated

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-11-03 21:30:48 +00:00
Smit Barmase ce6c5413f1 ui: Open submenus and popovers on the side that has room (#66496)
Follow up of https://github.com/zed-industries/zed/pull/66482

Wide submenus could open on top of their own menu, and popovers near the
window bottom got pushed up over their button. The side was picked while
rendering, before the menu's real size was known, so submenus guessed
200px wide and popovers never switched sides at all.

This adds `Anchored::attach(target, corner)` to GPUI, which picks the
side during layout using the real size and moves the element to the
other side of the target when it doesn't fit. Submenus and `PopoverMenu`
use it.

`DropdownMenu` now opens left-aligned under its button, and settings row
dropdowns opt into right alignment.

Left out on purpose:
- Pickers can switch between above and below as the list shrinks while
you type. Using the side that fits seems better than a stale one.

Before:
<img width="300"
src="https://github.com/user-attachments/assets/9a45aba2-6149-4835-8aa5-c2e8ae49c9b2"
/>


After:

<img width="300"
src="https://github.com/user-attachments/assets/148e205d-dd6b-4c59-9ed4-5ad37054725e"
/>

<img width="300"
src="https://github.com/user-attachments/assets/88a24ac6-e1c5-4e92-b9be-26f813b1b576"
/>


Release Notes:

- Fixed wide submenus and popovers covering the menu or button they open
from.
- [GPUI] Added `Anchored::attach` to place an element next to a target
and flip it to the other side when it doesn't fit.
2026-11-03 20:28:13 +00:00
Danilo Leal b61f33f8b6 ui: Support persistent submenu refresh (#66336)
Allow submenus to refresh their contents without closing the menu. This
supports updates to checkmarks, counts, labels, enabled states, and
removed entries.

- Retain submenu builders and use consistent confirmation behavior for
mouse and keyboard input.
- Add opt-in parent refresh, using stable submenu IDs to preserve an
open child when its trigger changes label or position.
- Repair keyboard selection after entries disappear. Close only the
child when it has no selectable entries or its trigger becomes disabled
or is removed.

## 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-03 19:12:27 +00:00
Kirill Bulatov 57dfd54ade Fix Vim visual-block hang at wrapped EOF (#66118)
Closes https://github.com/zed-industries/zed/issues/66116

Release Notes:

- Fixed Vim visual-block hang at wrapped EOF
2026-11-03 17:49:05 +00:00
Kirill Bulatov 8a47b35109 Do not panic on wrong grammar results (#66474)
Closes https://github.com/zed-industries/zed/issues/65051

Adjust the code to not panic if an underlying grammar returns an error.
This does not fix the slim extension per se, instead just not showing
any highlights at all.

To fix Slim extension, it has to update to a never tree-sitter grammar
that contains the fix.

Release Notes:

- Fixed a panic when underlying tree-sitter highlights fail
2026-11-03 13:37:20 +00:00
Ben Brandt d36a706614 acp: Support background work in ACP v2 (#66446)
Implements the background work additions to the ACP v2 spec
([RFD](https://agentclientprotocol.com/rfds/v2/background-work)).

- **`paused` tool calls:** `paused` is now its own `ToolCallStatus`. The
tool call card shows a pause icon with no spinner. Before this, `paused`
displayed as in progress.
- **Background list:** `AcpThread::background_work()` returns the
`background` list from the agent's latest state update. If the update
leaves it out, background work is unknown rather than empty. While the
session is idle and the agent reports background work, the label next to
the message editor shows "N tasks in background".
- **Stopping one tool call:** while a tool call advertises
`capabilities.cancel` and hasn't finished, its card has a Stop button
that sends `tool_call/cancel`. `AcpThread::cancel_tool_call` refuses
locally otherwise, because Clients must not send it unadvertised.
- **Stopping an agent-run terminal:** the terminal card's Stop button
also appears for agent-run terminals that advertise cancel and haven't
exited. It sends `terminal/cancel`, and its tooltip says the output
stays available.

Release Notes:

- N/A
2026-11-03 11:36:55 +00:00
Ben Brandt 601a7cc8ac acp: Track subagent working directories (#66440)
Implements the `cwd` and `additionalDirectories` fields that the
[subagents RFD](https://agentclientprotocol.com/rfds/subagents) adds to
`subagent_update`. Zed previously dropped them.

- `SubagentAssociation` stores both fields as nullable patches: omitted
leaves a field unchanged, `null` clears it, and a value replaces it.
- A field the parent hasn't reported is inherited from the parent's own
working directories, and the two fields inherit independently. Each ACP
subagent's effective directories become its `work_dirs`. When a parent's
directories change, nested subagents are updated too. Native subagents
are unchanged.
- v1 updates now carry both fields. A relative path is ignored with a
warning, the same way v2 ignores a malformed field.
- In v1, a subagent's `terminal/create` without a `cwd` runs in the
subagent's effective `cwd`, as the RFD requires. Root sessions are
unchanged.

Release Notes:

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

Release Notes:

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

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

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

Release Notes:

- N/A
2026-11-03 11:14:40 +00:00
Lukas Wirth 0294cfb58e gpui_windows: Preserve native tab advances (#66468)
## Summary

Fix zero-width tabs in GPUI text on Windows by preserving DirectWrite’s
native tab advances.

DirectWrite represents tabs as zero-glyph drawing runs. GPUI previously
skipped those runs and accumulated only glyph advances, losing tab
spacing. Query each tab’s native hit-test width and include it in the
accumulator, with an invisible space-glyph entry for caret/index
mapping.

Keep the original text, DirectWrite’s native tab-stop policy, and GPUI’s
existing logical-order glyph placement. This does not introduce a
four-space policy or attempt to unify tab stops across platforms.

## Attribution

Follow-up to #66455 by @leafyoung, which identified the zero-width tab
issue and proposed a fix. This takes a different implementation approach
using native layout advances.


Release Notes:

- [GPUI] Fixed zero-width tabs in text on Windows by preserving native
DirectWrite tab advances and caret positions.

Co-authored-by: Yang Ye <yangye@techntea.com>
2026-11-03 10:11:37 +00:00
Kirill Bulatov 8e8f54c67e Actualize all-settings.md contents (#66410)
Update stale defaults and add missing entries from default.json

Release Notes:

- N/A

---------

Co-authored-by: Finn Evers <finn@zed.dev>
2026-11-03 10:09:54 +00:00
Ahmed Tajelsir 504abf602a feat: config to toggle edit prediction button in the status bar (#66450)
## Summary

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


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

## Testing

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

## Self-review

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

Release Notes:

- Added an `edit_predictions.button` setting to toggle the edit
prediction button in the status bar
2026-11-03 09:14:29 +00:00
Smit Barmase 37568ad7dc ui: Support embedded views in context menu submenus (#66461)
Needed for: https://github.com/zed-industries/zed/issues/66458

I ran into this while adding branch mode to the git panel, where I
needed a searchable picker inside a context menu submenu. This lets a
submenu host a focusable view like that.

What changed:
- While a submenu is open, the parent menu no longer pulls focus away
from content inside it, such as a search field.
- `ContextMenu::embedded_view(view)` adds a view without the menu's row
padding. A menu that only holds embedded views also drops the list
padding.
- `ContextMenu::focus_content(handle)` is optional. It sends a submenu's
focus to that handle when the submenu opens by hover, the arrow keys, or
Enter, and after a click on a part of the content that can't take focus.
Without it, menus behave as before. The git panel's base branch picker
uses this to focus its search field.

Left out on purpose:
- Accessibility roles for embedded views. I don't know much about this
area, and I think it can be skipped for now.

<img width="350"
src="https://github.com/user-attachments/assets/8436653c-12fc-48dd-953d-bf0ee88fe8bc"
/>

Release Notes:

- N/A
2026-11-03 08:44:49 +00:00
Andri Soone 504a7f2cf2 Allow mouse wheel zoom in terminals and diff views (#66296)
## Summary

I like to use the mouse wheel zoom functionality on the code to change
the size in Zed. It's very useful when switching between screens of
different sizes for example.

Unfortunately it only works when a file is opened, not in the diff view
or the terminal, and diff view is pretty much the only view I use
nowadays. So whenever I want to change the font sizes, I have to click
"Open file" to zoom there.

This has been annoying me for months so I fixed it with the help of
Claude Opus 5.5 High.

The agent diff and terminals in the agent panel still don't zoom on
purpose (decision made in #53598 apparently).

### Before


https://github.com/user-attachments/assets/eb47fae2-d82f-4bfc-adbe-3a3c7223bacb

### After


https://github.com/user-attachments/assets/84cd86ae-d589-457b-8ab0-733cfb60177f

## Testing

I tested on macOS 27.0.1 (26A434) and Zed 1.27.0 (37faef81f7).

### Reproduction steps
- Enable `mouse_wheel_zoom` in settings.
- Open any file diff and the terminal view.
- Do Cmd + Scroll (or Ctrl + Scroll on non-Macs) in the code and
terminal.
- Previously, they didn't change the font sizes. After this commit they
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:

- Added support for mouse-wheel font zoom in diff views and terminals.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-11-02 22:26:26 +00:00
Piotr Osiewicz 00b86477f8 debugger: Allow configuring the default panel size (#66435)
Closes #66412

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

## Testing

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

Release Notes:

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

Co-authored-by: Amp <amp@ampcode.com>
2026-11-02 17:27:20 +00:00
Michal Matczuk f4d40a2ccb git_ui: Drag files from the git panel to the terminal (#66423)
Files in the git panel's Changes list can now be dragged, just like
entries in the project panel.
Dropping a file on a terminal inserts its absolute path, and dropping it
on a pane opens it.

The rows reuse the project panel's `DraggedSelection` payload, so
existing drop targets accept them without changes.
When the dragged row is marked, the drag carries all marked files and
directories, and the preview shows the entry count.
Deleted files have no project entry and are not draggable.

<!-- Add a GIF of dragging files from the git panel to the terminal. -->

## Testing


https://github.com/user-attachments/assets/0d63ce06-057b-432b-97aa-747f6e8d09dd

## 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 support for dragging files from the git panel to the terminal
and editor panes.
2026-11-02 16:48:58 +00:00
Piotr Osiewicz f73feed9de http_client: Remove anyhow reexports (#66430)
## Summary

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

## Testing

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

## Self-review

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

Release Notes:

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

---------

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

## SDK 5 port

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

## Spec changes

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

## Follow-ups

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

Release Notes:

- Improved compatibility with the latest Agent Client Protocol,
including handling of missing sessions, plan updates, diff formats, and
cancellation of permission requests.
2026-11-02 15:26:50 +00:00
buvidk1234 e38d4ec980 Fix active repository selection after removing remote worktrees (#66299)
Removing a project folder containing the active Git repository from a
remote workspace could leave the Git panel showing “No Git Repositories”
and an “Initialize Repository” button, even when other Git repositories
remained open.

Select a remaining repository when the active repository is removed.
Preserve the current selection when removing another repository, and
clear it when the last repository is removed.

Testing:
- Added a regression test covering removal of an inactive repository,
the active repository, and the last repository.
- Confirmed the regression test fails before the fix and passes
afterward on Windows.
- Passed the existing remote worktree add/remove/re-add test.

Release Notes:

- Fixed the Git panel showing “No Git Repositories” after removing the
active repository's project folder from a remote workspace while other
repositories remain open.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-11-02 14:55:47 +00:00
buvidk1234 7a349ce42d Fix remote windows merging during session restoration (#66289)
## Summary

When two windows on the same remote host open directories `[A, B]` and
`[B, C]`, restarting Zed merges them into a single workspace containing
`[A, B, C]`.

During restoration, the shared directory `B` causes the second saved
workspace to match and reuse the first restored workspace.

Disable workspace matching and explicitly open a new window for each
saved remote workspace, preserving the original directory sets `[A, B]`
and `[B, C]` in separate windows.

## Testing

- Manually verified that `[A, B]` and `[B, C]` remain in separate
windows after restarting on Windows.
- Passed 6 related regression tests on Windows/MSVC with
`--test-threads=1`.
- Formatting and whitespace checks passed.

Release Notes:

- Fixed remote workspaces sharing a directory being merged into one
workspace after restarting Zed.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-11-02 12:52:59 +00:00
Zhehoo Morgen 1e47770804 debugger: Fix CodeLLDB schema validation for build-inferred configurations (#64133)
## Summary

Fix the false CodeLLDB schema warnings reported in the linked issue.

- Allow configurations with `build` to omit `request`.
- Apply launch/attach target checks only when `request` is present,
preserving target requirements for explicit requests even when `build`
is provided.

No debugger runtime behavior changes.

Closes #64132

## Validation
I created a tiny project with debug configuration following the
guidance, and turns out the build with the fix does not report issues
any more. Thus I consider that the fix is working properly.
### Before:
Zed reports 3 issues
<img width="1022" height="720" alt="Image"
src="https://github.com/user-attachments/assets/d42e5656-0b6c-4c25-b3ce-c991305902ba"
/>

### After:
Zed reports no issues
<img width="1500" height="642" alt="Image"
src="https://github.com/user-attachments/assets/0bf4d05f-6e58-410e-8ae6-450763a2a48c"
/>

Release Notes:

- Fixed false missing-property warnings for CodeLLDB debug
configurations using build-based target inference.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-11-02 12:45:55 +00:00
Riddhi Gupta 0967dd028c Fix C++ lambda specifier highlighting (#66406)
## Summary
Closes #66169

Fixed missing syntax highlighting for C++ lambda specifiers and the
defined preprocessor operator.

- Added lambda_specifier to the C++ keyword captures so mutable and
static lambda specifiers are highlighted correctly
- Highlighted defined as a preprocessor keyword
- Highlighted the identifier inside defined(...) as a macro constant
- Add a regression test to verify that all four tokens receive the
expected captures.

## Testing

- cargo test -p languages: 109 passed, 0 failed
- cargo test -p languages
test_cpp_highlights_query_captures_lambda_and_defined_keywords: passed
- cargo fmt --all -- --check: passed.

Manually tested on Windows using a locally built Zed instance:
<img width="512" height="471" alt="zed_test"
src="https://github.com/user-attachments/assets/f4ae3b5b-5e3e-4eb9-9d96-caf8923a37a0"
/>

## 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 missing syntax highlighting for C++ lambda specifiers and the
defined preprocessor operator
2026-11-02 12:37:09 +00:00
Gaauwe Rombouts 9e23c1f43e docs: Load c15t from the hosted CDN (#66413)
Replace the vendored c15t v2 bundle with the Inth-hosted c15t v3 script.

Release Notes:

- N/A
2026-11-02 12:29:02 +00:00
Yossi Eliaz 6569db7470 remote: Accept shell-quoted ssh executable in SSH command lines (#66360)
## Why

Remote Projects accepts either a bare destination or a full `ssh ...`
command. Commands that tools print with every token shell-quoted (for
example `'ssh' '-p' '64042' 'user@127.0.0.1'`) work in a shell but Zed
rejects them with `unsupported argument`. The goal is that any valid SSH
command pasted into **Connect New Server** parses the same way whether
or not its tokens are quoted.

Closes #61101

## Summary

`SshConnectionOptions::parse_command_line` stripped a literal, unquoted
`ssh ` prefix from the raw string before tokenizing. With a quoted
`'ssh'`, the prefix didn't match, so after tokenizing `ssh` became the
hostname and the real destination was rejected as an extra argument.

This change tokenizes first and then drops a leading `ssh` token when
more tokens follow. A lone `ssh` is still treated as a hostname, as
before.

## Testing

- Added `test_parse_command_line_with_ssh_executable` covering unquoted,
single-quoted (including an identity path with spaces), and
double-quoted `ssh` executables, plus `ssh` used as a host. It fails on
`main` with `unsupported argument: "user@127.0.0.1"` and passes with
this change.
- `cargo test -p remote`: 56 passed
- `cargo fmt -p remote -- --check`
- `./script/clippy -p remote`

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

AI disclosure: this change was AI-assisted. I reviewed the diff and the
test.

Release Notes:

- Fixed Remote Projects rejecting SSH commands whose `ssh` executable is
shell-quoted.
2026-11-02 12:01:06 +00:00
Som 1e77078b3a zed: Don't let a second launch overwrite the session ID (#66364)
## Summary

Closes #65166

When launching `Zed.exe` on Windows while an instance is already open,
the second process spawns `Session::new`, which immediately writes a
fresh session ID to `kv_store`, before hitting the single-instance check
and exiting. As the issue traces, on the next cold start Zed looks up
workspaces under that orphaned ID and restores nothing.

This moves `Session::new` below the single-instance check so only the
primary instance records a session ID. Nothing before the check uses
`session` or `session_id` (both the crash handler and `app.run` come
after).

*(Note: This only fixes the secondary-launch overwrite, not the
`app_will_quit` timeout in the issue logs.)*

## Testing

No unit test added since the ordering is inline in `main()` behind the
instance mutex (happy to factor out the startup sequence for a test if
you'd like).

Tested manually on Windows 11 (debug build with
`ZED_RELEASE_CHANNEL=nightly` so the single-instance check runs,
`ZED_UPDATE_EXPLANATION` set, and a temp `--user-data-dir`):
1. Opened a workspace, launched `zed.exe` 3 more times, and checked
`kv_store.session_id` in `db/0-nightly/db.sqlite` after each.
- **Before:** Overwritten on every extra launch while the active
workspace kept the initial ID.
- **After:** Stayed `b09be725-a782-4231-9686-90b43ba1c2a1` across all 3
launches.
2. Force-killed the instance (`taskkill /F`) and relaunched: wrote a new
ID (`91a430ae-3040-472c-b8cb-e873867d0ffe`) and restored the workspace
as expected. I haven't tested an orderly quit (Ctrl+Q) and relaunch.

Not run on Linux or macOS, which go through the same check block.

Local `cargo fmt --all -- --check` and debug `cargo clippy -p zed
--all-targets -- --deny warnings` pass.

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

Release Notes:

- Fixed launching Zed on Windows while it was already running causing
the previous session not to be restored.
2026-11-02 11:55:20 +00:00
yskim bc6fc11740 gpui_windows: Keep child windows above GPUI content (#66368)
## Summary

> On Windows, a WebView2 attached as a child window inside a GPUI window
isn't visible. Because of this, I can't work with Claude/Codex
artifacts.

Windows GPUI 창 안에 webview2를 자식 창으로 붙이면 안보인다. 그래서 claude/codex의 아티팩트를 조작할
수 없다.

> The cause analysis and test notes below were investigated and written
up together with an AI assistant (Claude). I checked the before/after
screens myself.

아래 원인 분석과 테스트 기록은 AI(Claude)와 함께 조사하고 정리한 내용이다. 전후 화면은 내가 직접 확인했다.

> **AI-generated (Claude):**
>
> **Cause.** `DirectComposition::new` creates the composition target
with `CreateTargetForHwnd(hwnd, true)`. Per the [`CreateTargetForHwnd`
docs](https://learn.microsoft.com/en-us/windows/win32/api/dcomp/nf-dcomp-idcompositiondevice-createtargetforhwnd),
a window is composed bottom to top as: the window's own content, the
non-topmost composition tree, child windows, the topmost composition
tree. GPUI creates its DirectComposition windows with
`WS_EX_NOREDIRECTIONBITMAP`, so everything it draws lives in the
composition tree. With `topmost = true` that tree is drawn over every
child HWND, and a WebView2 hosted with wry's `build_as_child` is covered
completely. With `false` the tree goes below child windows.
>
> The target is created only in `DirectComposition::new`, which runs at
startup and again when recovering from a lost device, so this one line
covers both paths.
>
> The workaround today is `GPUI_DISABLE_DIRECT_COMPOSITION=1`. It
switches every window to an HWND swap chain and gives up transparent,
blurred and Mica backgrounds. Related: #34374 (suggested hosting the
webview as a composition visual instead), #54433 (contained this same
one-line change inside a larger WebView feature PR, closed for scope).
#62379 keeps `true` and doesn't change this.
>
> **Trade-off.** Child HWNDs now draw above GPUI-drawn menus, popovers
and tooltips, as they did before the DirectX renderer. Zed itself
doesn't create child windows, so Zed's own rendering is unaffected.
>
> **Testing.** Windows 11 26100, NVIDIA GTX 1080, WebView2 156, debug
builds of main @ ba63a022c9.
>
> - Minimal GPUI + wry window (adapted from
[huacnlee/gpui-wry-example](https://github.com/huacnlee/gpui-wry-example)):
the WebView2 is hidden on main and visible with this change. It's also
visible on main with `GPUI_DISABLE_DIRECT_COMPOSITION=1`.
> - Zed with `background.appearance` set to `opaque`, `transparent`,
`blurred` and `mica_backdrop`, captured at two window sizes and compared
with main: no visible difference.
> - Lost device, using a real GPU timeout (`dxcap -forcetdr`): GPUI logs
`DirectX device lost detected (0x887A0007)` and then `DirectX devices
successfully recreated`, and Zed keeps rendering. Forcing only GPUI's
recovery path (without a real timeout) keeps the WebView2 visible.
> Caveat: after a real GPU timeout, a WebView2 page that isn't
repainting stays blank until its bounds change (resizing the window
brings it back), while an animating page keeps showing. With
`GPUI_DISABLE_DIRECT_COMPOSITION=1` the static page survives the
timeout; why is not yet clear.
> - [Herdr UI](https://github.com/penso/herdr-gpui) (a GPUI app, on
gpui-pre 0.3.6 = zed@bcf6582) with the same one-line patch: its browser
tab shows the page instead of a blank area (penso/herdr-gpui#826). The
original report there is on an AMD Radeon 780M.

| main (`true`) | this PR (`false`) |
| --- | --- |
| <img width="480" alt="main: WebView2 area is blank"
src="https://github.com/user-attachments/assets/45a98c8d-9ef8-46ea-8f7b-8d01547db5ee"
/> | <img width="480" alt="this PR: WebView2 is visible"
src="https://github.com/user-attachments/assets/533948d9-595b-4507-ad36-311b7c793de8"
/> |

| Herdr UI, before | Herdr UI, after |
| --- | --- |
| <img width="480" alt="Herdr UI before: browser tab is blank"
src="https://github.com/user-attachments/assets/08089173-f2be-4e05-ae2c-2a2ad270b3b2"
/> | <img width="480" alt="Herdr UI after: page is visible"
src="https://github.com/user-attachments/assets/850f394d-51a9-477c-993c-4a21cc6f90ae"
/> |

## Self-review

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

Release Notes:

- [GPUI] Fixed child windows (such as a WebView2 hosted with wry) being
covered by GPUI content on Windows.

---------

Co-authored-by: yskim <20632260+yskim3271@users.noreply.github.com>
2026-11-02 09:42:01 +00:00
max1ab 1d76f828ee Fix SVG images in remote Markdown previews (#66404)
## Summary

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

Closes #64517

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

## Testing

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

## Self-review

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

Release Notes:

- Fixed SVG images failing to render in Markdown previews for remote
projects.
2026-11-02 09:16:49 +00:00
M0_kii b41a8b60a4 Fix Windows shell detection for uppercase executable names (#66387)
## Summary

Zed was detecting `CMD.EXE` as PowerShell because the filename check was
case-sensitive. This fixes shell detection on Windows while keeping Unix
behavior unchanged.

## Testing

- Built and ran Zed on Windows. A task using `"shell": {"program":
"CMD.EXE"}` and `"command": "echo zed-shell-case-probe"` printed
`zed-shell-case-probe`.
- Added regression tests covering 22 Windows and Unix cases.
- `cargo fmt --all -- --check` and `./script/clippy.ps1 -p util
--locked` passed.
- `cargo test -p util --locked`: 128 unit tests and 2 doctests passed; 1
doctest ignored.
- Workspace doctests: 150 passed, 22 ignored.
- Full Windows workspace suite: 10,809 tests run, 26 skipped. Initially
10,798 passed, 3 failed, and 8 timed out. Nine setup-related cases
passed on retry after preparing the extension fixture, fetching the
remaining locked dependencies, and setting `CRITERION_HOME` to avoid
Criterion's runtime Cargo metadata lookup.

Two failures remain in unchanged tests, so the full suite is not
entirely green locally:

-
`extensions_ui::extension_suggestions::tests::test_suggestion_returns_after_failed_install`:
one pending installation where zero is expected; also fails in
isolation. This path downloads an extension through the fake HTTP
client, outside shell detection.
- `gpui_windows::window::tests::test_double_click_interval`: the test
assumes a 700 ms gap resets the click count, while this machine's
double-click interval is 760 ms.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI checklist: not applicable (no UI changes).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed Windows shell detection for executable names containing
uppercase letters.
2026-11-02 08:09:07 +00:00
Anthony Eid decd2399b1 gpui: Keep subscriptions for entities read by reused cached views (#65952)
When a cached view was reused, entities it read outside its recorded
scope lost their subscriptions, so notifying them no longer redrew the
window. Two cases:

- **Deferred draws.** `deferred(...)` elements are prepainted and
painted at window level after the element tree, outside the cached
view's recorded reads. Each deferred draw now records its own reads
alongside its reusable ranges and restores them when it's replayed.
- **Paint-phase reads.** A cached view recorded the entities read during
render, layout and prepaint, but not during paint, so a model read only
in a paint callback (for example a `canvas`) was dropped on reuse. Paint
reads are now added to the view's recorded set.

In both cases one set covers every phase and is restored when the
prepaint is reused, since the window only consumes it at the end of the
draw.

It also changes how scoped reads are recorded.
`detect_accessed_entities` used to clone every entity read so far in the
frame and diff against it afterwards, which cost O(frame reads) per
cached view (and now per deferred draw), and dropped entities that
something earlier in the frame had already read. Reads are now recorded
in a stack of scopes: each read goes into the innermost scope, and a
scope's reads are added to its parent when it ends. Each scope now gets
exactly its own reads, at a cost proportional to those reads.

Restoring a recorded set now skips entities released since it was
recorded. Previously the window subscribed to them again after `App` had
removed their subscriptions, leaking those entries for as long as the
cache kept being reused.

Tests cover a canvas paint read under a reused cached panel, with and
without a deferred draw around it, and with the panel itself deferred.
Each fix's case fails without it. A unit test covers nested scopes,
entities read before a scope began, and released entities. A unit test
covers nested scopes recording entities read before them.

Known limitation (unchanged): notifying a non-view entity read by a
cached view redraws the window but doesn't mark that view dirty, because
`mark_view_dirty` only resolves views through the dispatch tree.

Release Notes:

- [GPUI] Fixed entity notifications failing to redraw windows when the
entity was read by a deferred draw or a paint callback inside a reused
cached view.

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
2026-11-02 02:57:05 +00:00
Anthony Eid 26abd1c959 gpui_platform: Extend benchmarks and add a two-revision comparison script (#66316)
Extends the GPUI benchmarks in `gpui_platform` and adds
`script/gpui-bench-compare` for quick before/after comparisons. No
runtime behavior changes. The only new GPUI APIs are
`bench-support`-only: `Window::rendered_scene()` and
`BenchWindowContext::simulate_resize`.

## Benchmarks

- **`RandomizedTree/mixed` and `CachedTree/mixed`:** the general
benchmark. Each iteration applies a fixed, seeded sequence of changes to
a freshly built tree, one per frame: restyles, resizes, structural
edits, reorders, pointer moves, scroll events, focus moves and window
resizes, while some entities animate. Every iteration does exactly the
same work.
- **Single-change groups:** element style, leaf bounds, root layout,
insert/remove, reorder and hover. They explain where a difference in the
mixed workload comes from.
- **`CachedTree`:** the same workloads with entities wrapped in
`.cached()`.
- **`TextPanels`, `Scroll` and `LayoutChurn`:** text updates and first
frames, three scrolling workloads, and entity/ID/text churn.
`LayoutChurn` also prints a heap check before timing.
- **`Primitives`:** seeded random quads, shadows, underlines, paths and
text, plus fixed overlap patterns, painted through a window and directly
on `Scene`.
- **The randomized tree fixture:** now draws paths, shadows, scroll
containers, text, hover styles and optional animations.

The benchmarks don't check their output; that's left to the fixture's
tests. On macOS and Linux, frames include GPU submission through the
headless renderer. Text benchmarks are skipped on Windows and on macOS
without `font-kit`, because neither has a real headless text system.

## Comparison script

`script/gpui-bench-compare BASE NEW` builds both revisions once and
alternates short runs of 25 core cases. It reports foreground
instructions per frame, wall time and run-to-run spread, in about 3
minutes. It also accepts `--filter`, `--full`, `--repetitions` and
`--slow`. Both revisions must include this PR.

## Validation

- A/A runs: within ±0.15% on the mixed cases and ±0.34% or better on the
core suite.
- All 193 `--test` cases pass (`SEED=0 ITERATIONS=1`,
`bench-support,font-kit,inspector`).
- The fixture's tests and `./script/clippy` pass.
- A full `cargo bench` takes about 13 minutes on an M-series Mac. I
haven't run it on Linux.

## Follow-ups

- Add hiding the root to `CachedTree/mixed` once the `.cached()`
visibility bug is fixed.
- Add text edits, keyboard input, scale changes, overlays, virtual
lists, images and drag and drop to the mixed workload.
- Add images and SVG icons to the `Primitives` random case.
- Measure GPU time, memory and upload bandwidth next to CPU
instructions.
- Cover hover and animation in the fixture's render-equivalence test.
- Bring the window-painted `Primitives` random case into the core suite
once GPU noise is separated out.

Release Notes:

- [GPUI] Added a mixed-workload benchmark, plus cached-view, hover,
text, scrolling, layout-churn and primitive benchmarks, and
`script/gpui-bench-compare` for quick instruction-count comparisons
between two revisions
2026-11-02 02:46:28 +00:00
Ben Brandt f816e1f926 gpui: Render macOS window screenshots offscreen (#66344)
`MetalRenderer::render_to_image` rendered a window's screenshot into the
layer's next drawable. Since macOS windows began presenting through a
`CAMetalDisplayLink`, the display link owns the layer's drawables, and
calling `nextDrawable` raises `CAMetalLayerInvalidOperation:
-nextDrawable should not be called when using CAMetalDisplayLink`, which
aborts the process. Every caller of `Window::render_to_image` on a live
macOS window crashed on its first screenshot, which broke automated UI
testing in apps built on GPUI.

This renders the screenshot into a texture of its own instead. It moves
the offscreen path that `render_scene_to_image` already used for
headless rendering into a shared `render_offscreen` helper, including
the blit that managed textures need on Intel Macs, and has
`render_to_image` call it at the layer's drawable size. Nothing is
presented, so taking a screenshot no longer touches what the display
link draws.

Tested by taking automation screenshots of a running GPUI app on macOS,
which aborted before this change and succeed with it.

Release Notes:

- [GPUI] Fixed a crash when capturing a macOS window with
`Window::render_to_image` while a display link drives its layer

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-11-01 22:52:58 +00:00
Lukas Wirth c408f8efc4 gpui: Improve borrow and window error diagnostics (#66358)
## Summary

- Preserve the attempted borrow location and existing App borrow origin
in fallible borrow errors, using a compact anyhow result without a
redundant standard borrow error.
- Propagate caller locations through window-update wrappers and share
diagnostic formatting between returned errors and panics.
- Add operation and window context to all 34 log_err sites in window.rs.
Context formatting runs only on failure.

## Validation

- cargo nextest run -p gpui app::test:: — all 5 existing tests passed.
- Formatting checks passed for the changed Rust files.
- No test changes are included in this PR.
- The original Delta reentrancy trigger was not reproduced; this
improves diagnostics, not the underlying reentrancy behavior.

Release Notes:

- [GPUI] Improved App borrow and window-operation errors with caller
locations, borrow origins, and operation context.
2026-11-01 20:27:09 +00:00
Chris Stone d94f32a1d9 Terminal header corners (#66367)
## Summary

The terminal tool header in the agent panel paints its own background,
but the card it sits in clips its contents to a rectangle, so the
header's square corners poke out past the card's rounded corners. The
command block inside the header also painted its own copy of the header
background with square corners, which showed at the bottom of collapsed
cards.

This change rounds the header's top corners for standalone terminal
cards, and its bottom corners too when nothing is rendered below it
(i.e. the card is collapsed and not awaiting confirmation). The command
block no longer paints its own background inside the card, since the
header already paints the same color behind it. When the card is
expanded or showing a confirmation prompt, the header's bottom corners
stay square so it joins the content below it.

Follow-up to #64328, which fixed the same issue for the terminal
output's bottom corners.

The issue is barely visible in the bundled themes, because their
`element.background` (which the header is based on) is the same or
nearly the same as `panel.background`:

**Stock One Dark:** the corner mismatch is nearly invisible.
<img width="603" height="208" alt="Terminal tool card in stock One Dark"
src="https://github.com/user-attachments/assets/1392f06e-3d31-4906-8e32-13b482a1e5c3"
/>

It's clearly visible in themes where those colors differ, which is
common in theme extensions. To make it obvious, give the header a
contrasting background with a theme override:

```json
"theme_overrides": {
  "One Dark": { "element.background": "#ff5555" }
}
```

### Before

**With the override:** the header's square corners show past the card's
rounded corners.
<img width="600" height="202" alt="Terminal tool card with a red header
background, square corners showing past the card"
src="https://github.com/user-attachments/assets/8d4e0701-d3cc-4bd2-9046-bab139a1459a"
/>

**Collapsed card:** the bottom corners are square too.
<img width="605" height="122" alt="Collapsed terminal tool card with
square corners showing past the card"
src="https://github.com/user-attachments/assets/4c186b96-c899-4cba-bf79-898015d7cb5a"
/>


### After

**Same card with the fix:** the header follows the card's rounded
corners.
<img width="640" height="202" alt="Terminal tool card with a red header
background, corners matching the card"
src="https://github.com/user-attachments/assets/7dbaffb1-668a-4e88-a81e-40952f8174f4"
/>

**Collapsed card with the fix:** all four corners are rounded.
<img width="641" height="122" alt="Collapsed terminal tool card with all
four corners rounded"
src="https://github.com/user-attachments/assets/33f19131-3e06-4d6f-a9ea-7c96f41e512e"
/>

## Testing

Tested manually on Windows.

With the theme override above, run a terminal command in the agent panel
and check:

- Collapsed card: all four header corners are rounded and match the
card.
- Expanded card: top corners are rounded; bottom corners are square
where the header meets the output.
- Card awaiting confirmation: top corners are rounded; bottom corners
are square.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior. (Not added: this is a
purely visual styling change, verified manually with the screenshots
above.)

Release Notes:

- Fixed square corners showing on terminal tool cards in the agent panel
with themes whose element background differs from the panel background.
2026-11-01 07:50:34 +00:00
Om Chillure a4b39c38e0 markdown_preview: Stop rounding image corners (#65474)
## Summary

Closes #65311

Images in the Markdown preview were always drawn with rounded corners,
because `MarkdownElement` applied `.rounded_md()` to every image. Badges
such as shields.io looked different from how GitHub and browsers render
them.

The rounding was added on purpose for images in the agent panel
(#56427), so this PR doesn't remove it everywhere. It adds a
`rounded_images` field to `MarkdownStyle`, which defaults to `true`. The
preview style overrides set it to `false`. Other uses of
`MarkdownStyle`, including the agent panel, look the same as before.

If reviewer prefer that images stay square everywhere, the alternative
is to drop the `.rounded_md()` call and the new field. That's simpler
but also changes the agent panel. I can change current apporach to this
if needed.


### Before
<img width="1920" height="1080" alt="Screenshot from 2026-10-11
17-55-18"
src="https://github.com/user-attachments/assets/6e96bfd2-b516-4c8e-815e-fb49b7a394af"
/>

### After
<img width="1920" height="1080" alt="image"
src="https://github.com/user-attachments/assets/07d7ca1b-69ff-4a5d-a66b-1a2026c6e561"
/>


## Testing

- `cargo check -p markdown -p markdown_preview` passes.
- `cargo test -p markdown`: all 186 existing tests pass. No new test was
added because this is a visual change.


To manual test, create a Markdown file containing:

![license](https://img.shields.io/badge/license-MIT-blue?style=flat-square)

Open the Markdown preview. The badge should have square corners. Then
paste an image into the agent panel and check that it's still rounded
there.


## 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 images in the Markdown preview being rendered with rounded
corners.
2026-11-01 00:33:56 +00:00
Kunall Banerjee ba63a022c9 recent_projects: Show remote picker scrollbar (#63909)
Make overflowing remote lists discoverable and size the scrollbar
accurately from the first layout, matching the Recent Projects picker.

Closes #63856.

## Self-Review Checklist:

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

---

Release Notes:

- Fixed a missing scrollbar in the Open Remote picker, making additional
remote servers easier to discover
2026-10-31 04:59:47 +00:00