Commit Graph
39231 Commits
Author SHA1 Message Date
Eric Holk 414e6fe31e client: Extract proxy handshakes into a new proxy_handshake crate (#61427)
This consolidates the proxy code in `client/src/proxy` into a new
`proxy_handshake` crate that implements the client side of HTTP CONNECT
and SOCKS4/4a/5/5h handshakes sans-IO: the protocol logic is a pure
state machine that never touches a socket, with thin drivers behind
`futures-io` and `tokio` feature flags. `client` now drives the
websocket's proxy tunnel through the tokio driver, and the `tokio-socks`
dependency goes away.

The main win is testability: the handshakes are now covered by
synchronous byte-level tests on both sides of each exchange, plus a
property test that the outcome is invariant under how the proxy's bytes
are chunked across reads — the class of partial-read bug that's hard to
hit with hand-written tests but easy to hit in production behind a
buffering proxy. The crate is written as if it were standalone (no
zed-internal dependencies, structured errors instead of `anyhow`), which
is also why it grows both driver flavors rather than just the one
`client` needs today.

Two deliberate behavior changes, both converging on spec/curl semantics:

- Proxy credentials embedded in URLs are now percent-decoded before use,
per RFC 3986 §3.2.1. Previously they were sent in their encoded form,
which only worked for credentials with no reserved characters. A
password that literally contains something like `%40` and relied on the
old behavior now needs the RFC-correct `%2540` spelling.
- `NO_PROXY` is now honored for the collaboration connection, matching
the exclusions reqwest already applies to the rest of Zed's HTTP
traffic.

TLS to the proxy itself (for `https://` proxy URLs) and DNS policy stay
in `client`, since those are I/O concerns the sans-IO crate deliberately
doesn't own.

Release Notes:

- Improved proxy support: the collaboration connection now respects
`NO_PROXY` and percent-encoded proxy credentials.
2026-07-23 22:46:06 +00:00
saberoueslati 1db5b3ae06 project: Prevent empty external formatter output from clearing buffers (#61276)
## Context

Zed runs external formatters as stdin/stdout filters: it writes the
current buffer to stdin and replaces the buffer with the formatter's
stdout. Commands such as `cargo fmt` instead rewrite files on disk and
exit successfully without producing stdout, causing Zed to interpret the
empty output as the formatted contents and clear a non-empty buffer.

The fix treats empty stdout from a successful external formatter as no
output when the original buffer is non-empty. Zed leaves the buffer
unchanged and displays a notification explaining that the formatter did
not return formatted contents. The formatter documentation now clarifies
the stdin/stdout contract and recommends using the Rust language server
or invoking `rustfmt` directly.

Closes #56344

Behavior before the fix :

[Screencast from 2026-07-19
02-58-29.webm](https://github.com/user-attachments/assets/61fc5bf9-4420-43f1-94a3-394bbbc4f2a0)


Behavior after the fix :

[Screencast from 2026-07-19
02-55-35.webm](https://github.com/user-attachments/assets/21062065-6b95-4cd4-8200-506f5681d98e)


## How to Review

**crates/project/src/lsp_store.rs**  
Start with `format_via_external_command`, which now checks whether a
successful formatter returned empty stdout while the input buffer was
non-empty. In that case, it returns `None` before constructing a diff,
preventing the buffer contents from being replaced with an empty string.
Then review the external formatter branch in `apply_formatter`: when it
receives `None`, it skips extending the formatting transaction, logs the
condition, and emits an `LspStoreEvent::Notification` explaining why the
buffer was left unchanged.

**crates/editor/src/editor_tests.rs**  
Adds a GPUI regression test that configures an external command to
consume stdin and return no stdout. It uses platform-specific commands
for Windows and Unix, invokes manual formatting on a non-empty Rust
buffer, and verifies that the buffer remains unchanged, the operation is
not recorded as a formatter failure, and a notification is emitted.

**docs/src/reference/all-settings.md**  
Extends the external formatter documentation to state that formatters
must return the formatted buffer through stdout. It calls out
file-rewriting tools such as `cargo fmt` as incompatible and recommends
using the Rust language server or `rustfmt --emit stdout`.

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed external formatters that produce no output clearing non-empty
buffers
2026-07-23 21:21:38 +00:00
Shuhei Kadowakianddino 3c9a3d4176 editor: Preserve preview tabs for references multibuffers (#61021)
When `preview_tabs.enabled` and
`preview_tabs.enable_preview_multibuffer_from_code_navigation` are
enabled, Find All References opens its multibuffer as a preview tab.

A references multibuffer is assembled from existing buffers, which may
already contain edits when the preview is created. When creating the
multibuffer to display the references, it ends up emitting edit events
as excerpts are added, this will later cause `Pane::handle_item_edit` to
run, which would see these buffer edits since `Buffer::preview_version`
and unpreview the tab, as the `Buffer::preview_version` value was not
being updated after edits.

Refresh the multibuffer’s preview baseline before opening a newly
created code-navigation multibuffer as a preview. Background diff
updates then preserve the preview, while subsequent user edits still
make it permanent. This leaves the existing editor event and search
invalidation behavior unchanged.

Release Notes:

- Fixed `editor: find all references` preview tabs becoming permanent
tabs if any of the buffers had been edited before

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-07-23 18:56:45 +00:00
Anant Goel 3a547a44df bedrock: Fix duplicated messages and colliding tool call ids from Bedrock Mantle (#60998)
## Problem

AWS Bedrock's Mantle endpoint (used for GPT-5.x models via the
OpenAI-compatible Responses API) has two independent bugs that both
cause visible duplication/corruption in the agent panel:

1. **Duplicated message text.** Mantle streams a reply as a series of
new `message` output items, where each new item's text is a growing
prefix-superset of the previous one, and the full `output_text.delta`
sequence is replayed for each item. Forwarding these events through the
shared `OpenAiResponseEventMapper` unmodified caused the assistant's
reply (and its phase/reasoning metadata) to appear duplicated in the UI.
2. **Colliding tool call ids.** Mantle assigns raw `tool_use` ids as a
simple per-request counter (`call_1`, `call_2`, ...) that resets to
`call_1` on every request/response cycle to the model — including
separate cycles within a single agent turn as it performs tool calls
sequentially. Since `acp::ToolCallId` was built directly from that raw
id, and `AcpThread::upsert_tool_call` matches tool calls by id across a
thread's entire entry list, a later, unrelated tool call reusing a raw
id would silently overwrite an earlier, already-completed one instead of
appearing as a new entry — visible as "old tool calls getting replaced
by new ones."

Both were confirmed against real raw Mantle SSE traces and a real
persisted thread (`call_1` recurring across 10+ separate request cycles
within a single turn).

## Fix

**For message duplication:** `MantleResponseEventMapper` wraps
`OpenAiResponseEventMapper` and collapses adjacent, same-phase,
strict-prefix message extensions into a single logical message,
forwarding only the replayed suffix as ordinary incremental text.
- Only adjacent, same-phase, strict-prefix extensions are collapsed.
Equal, shrinking, divergent, or different-phase messages are still shown
as-is.
- Any non-message output item (reasoning, tool call) is a hard boundary:
it's forwarded unchanged and clears the merge state, so a message after
a tool call is never merged with the one before it.
- When a message is merged into the previous one, its `StartMessage` and
`ReasoningDetails` metadata events are suppressed, since they'd
otherwise duplicate what was already emitted for the first message.

**For tool call id collisions:** `scoped_tool_call_id(message_ix,
tool_use_id)` combines the raw provider id with the index of the
`AgentMessage` it belongs to in `Thread::messages`. That index is stable
for the lifetime of one request/response cycle (`flush_pending_message`
only runs on the next `StartMessage` event), so ids stay unique across
the whole thread without needing the raw provider id itself to be
globally unique. The index is threaded through explicitly from where
each tool call is created (`handle_tool_use_event`/`run_tool`) to where
it's later referenced (`process_tool_result`), rather than recomputed
later by re-reading `Thread::messages.len()`.

We deliberately did not rewrite the raw `tool_use` id itself at the
provider layer to make it globally unique, since that id round-trips
back to Mantle verbatim as `call_id` in `function_call_output` items on
the next request — rewriting it would require a fragile reverse-mapping
on every code path that replays tool results.

## Testing

- `cargo test -p language_models --lib bedrock` — 23/23 pass (11 tests
covering coalescing, independent messages, phase boundaries,
tool/reasoning boundaries, chained cumulative extensions, and metadata
deduplication).
- `cargo test -p agent --lib` — 699/699 pass (2 new regression tests for
tool call id scoping: one via live streaming across two request cycles
in one turn, one via persistence/`Thread::replay()` across two separate
turns).
- `script/clippy -p language_models -p agent` — clean.

Release Notes:

- Fixed duplicated assistant replies and colliding tool calls when using
GPT-5.x models on Amazon Bedrock's Mantle endpoint
2026-07-23 18:40:30 +00:00
MartinYe1234 d5f26118c5 agent: Fix edit_file failing to match exact mid-line old_text fragments (#61489)
Fixes the `edit_file` tool failing to resolve `old_text` fragments that
only cover part of a longer line. The streaming matcher compared the
query against whole trimmed buffer lines, so an exact substring like
`keyboard WASD, voxel-based` inside a much longer line failed the fuzzy
similarity threshold and the edit was rejected with "did not match any
content".

Supersedes #60615 — thanks to @ziimakc for the report, reproduction, and
initial investigation there. This PR takes a different approach based on
review feedback on that PR.

## Approach

- `StreamingFuzzyMatcher::push()` is unchanged: it still fuzzy-matches
completed lines incrementally so the UI can reveal the likely edit
location while `old_text` streams in.
- `finish()` now first searches the buffer for the complete raw query as
an exact byte substring (rope-native, overlap-aware KMP; no copy of the
buffer). Exact matches take precedence; fuzzy matching remains the
fallback for indentation drift, typos, and inserted/omitted lines.
- Exact matches are capped at two occurrences — enough to prove
ambiguity — and ambiguous or overlapping matches are rejected with the
existing "matched multiple locations" error instead of silently editing
one.
- The matcher now returns match candidates with their line alignment and
exact/fuzzy provenance in one result, and the edit pipeline uses that to
reindent correctly: for an exact mid-line match the first replacement
line keeps the retained prefix (zero delta) while subsequent lines get
the contextual indentation.
- The streaming parser now preserves the trailing newline of finalized
`old_text` (it still strips it from `new_text` to avoid duplicate line
endings, per #52661), so `"foo\n"` can disambiguate a standalone `foo`
line from `foo suffix`.

## Notes

- Exact-search cost is O(buffer + query) at finalization only; the
buffer is never copied into a `String` (the main concern with the
original PR).
- New regression tests cover mid-line fragments, exact-over-fuzzy
precedence, overlapping-match ambiguity, multiline replacement
indentation (spaces and tabs), trailing-newline disambiguation, and
newline-only edits.

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

Release Notes:

- Fixed agent edits failing when the text to replace is only part of a
line
2026-07-23 17:05:53 +00:00
Smit Barmase 737f3384f0 git_ui: Add option to commit with --no-verify (#61529)
Follow-up to #61185, which moved hook execution from Zed into `git
commit` itself. There was previously no way to skip hooks from the UI;
#59846 and #56318 attempted to add one on top of the old behavior. This
PR adds support on top of the new implementation.

Adds a “Skip Hooks” toggle to the commit menus in the Git panel and
commit modal, with a corresponding command-palette action. When enabled,
the next commit runs with `git commit --no-verify`, skipping pre-commit
and commit-msg hooks. The toggle clears after a successful commit or
when switching repositories, but remains enabled when a commit fails so
it can be retried.

Release Notes:

- Added a “Skip Hooks” commit option that skips pre-commit and
commit-msg hooks.
2026-07-23 15:45:21 +00:00
Lena 5ece0b3aaa CONTRIBUTING.md: Document the cap on simultaneous PRs (#61516)
We are trying out the new feature that GitHub rolled out, will see if it
is helpful.

Release Notes:

- N/A
2026-07-23 14:34:29 +00:00
Kirill BulatovandFinn Evers aa1fd6bff0 Calculate buffer chunks lazily (#61523)
<img width="1728" height="1084" alt="image"
src="https://github.com/user-attachments/assets/a560b10a-6e26-43ff-b830-c528e2dc6798"
/>

Before, each edit in a 50 MB plaintext file would trigger a lot of
anchor calculations (as chunk is 50 lines only) done on main thread +
did extra work when no language grammar or brackets were available.

The PR now moves all anchor calculations into `computed_chunks:
Mutex<HashMap<usize, RowChunk>>,` cache miss.
`TreeSitterData` is wrapped in `Arc` and shared as a part of the
snapshot, hence the need for `Mutex` and internal mutability here.

Trace after the changes:

<img width="1728" height="1084" alt="image"
src="https://github.com/user-attachments/assets/cb258980-8461-4559-b725-aef63c835e60"
/>


Release Notes:

- Improved input performance in large files

---------

Co-authored-by: Finn Evers <finn@zed.dev>
2026-07-23 13:36:40 +00:00
Finn Evers 711ade2324 Fix permission for pull request labelling script (#61525)
While its the `issues` API we use for labelling, it seems that GitHub
still wants PR permissions for those. Hence, fixing here.

Release Notes:

- N/A
2026-07-23 12:28:16 +00:00
Dino c0af112ad5 search: Fix expand/collapse button for non multibuffer items (#61519)
# Objective

Fix an issue where the button was being shown in the LSP log view even
because it's `Item::buffer_kind` implementation was returning the
default `ItemBufferKind::None` value.

## Solution

Update the `BufferSearchBar::needs_expand_collapse_option`
implementation to return `false` for all non-multibuffer items instead
of only returning false for singletons.

## Testing

Tested both manually as well as added a new test for this change –
`search::buffer_search::tests::test_no_expand_collapse_option_when_item_is_not_buffer_backed`.

## Self-Review Checklist:

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

## Showcase

<details>
  <summary>Before</summary>
<img width="3824" height="2482" alt="CleanShot 2026-07-23 at 11 18
37@2x"
src="https://github.com/user-attachments/assets/f435ca07-5eb0-4c16-b567-ea066dbc0ccd"
/>

</details>

<details>
  <summary>After</summary>
<img width="3776" height="2482" alt="CleanShot 2026-07-23 at 11 19
53@2x"
src="https://github.com/user-attachments/assets/b94e59cf-8888-470f-acd1-3bb1b714e62d"
/>

</details>

---

Release Notes:

- Fixed issue where "Collapse All Files"/"Expand All Files" button was
being shown in LSP Log View
2026-07-23 12:18:21 +00:00
Kirill Bulatov 336679c8e1 Fall back to file names in breadcumbs with LSP symbols (#61511)
Closes https://github.com/zed-industries/zed/issues/60905

Also makes the breadcrumbs to update on settings change — before, one
needed to focus them.

Release Notes:

- Improved breadcrumbs for `"document_symbols": "on"` case when no LSP
data is sent
2026-07-23 11:35:26 +00:00
Finn Evers 146a568c79 ci: Configure more steps more explicitly (#61401)
Also adds some Zizmor validations.

Release Notes:

- N/A
2026-07-23 11:25:56 +00:00
Finn EversandBen Brandt 25632b979b language: Refactor available_languages into its own struct (#61388)
This adds a dedicated `AvailableLanguages` struct in preparation for a
more cabable language matching based on a given language config. No
functional changes, just shuffling some code around for this round.

Also made the LanguageMatcher non-cloneable in favor of wrapping it in
an Arc, since cloning is rather expensive for this and having a
reference is sufficient in all cases right now.

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-07-23 11:22:43 +00:00
saberoueslatiandKirill Bulatov 97b51f2620 language: Fix JSON rainbow bracket colors across chunks (#60741)
## Context

JSON rainbow bracket colors could shift across row chunk boundaries when
large ancestor objects were omitted by the bounded tree-sitter bracket
query window. This fixes the chunk-local depth reset by caching bracket
chunk data together with the active bracket stack after each chunk, then
using that inherited stack when later chunks are computed. For JSON
object braces that are too large for the bounded query, the
implementation recovers active ancestor `{...}` pairs from the syntax
tree so sibling object braces keep the same color even when jumping
directly to a later chunk.

Closes #50185

## How to Review

`crates/language/src/buffer/row_chunk.rs` adds indexed access to row
chunks so bracket cache computation can walk from the nearest cached
chunk up to the requested chunk.

`crates/language/src/buffer.rs` changes bracket range caching from
storing only per-chunk matches to storing per-chunk matches plus the
active bracket stack after that chunk. It preserves the existing bounded
query and greedy-match repair behavior, while adding JSON-specific
ancestor recovery for large object braces omitted by
`MAX_BYTES_TO_QUERY`.

`crates/language/src/buffer_tests.rs` adds a JSON regression fixture
that exceeds `MAX_BYTES_TO_QUERY`, fetches a later chunk before earlier
chunks, and verifies all same-depth sibling object braces keep the same
`color_index` across row chunks.

Video of manual test below :

[Screencast from 2026-07-10
08-09-30.webm](https://github.com/user-attachments/assets/fca6425b-b79c-4097-b4af-148db6aa23d9)


## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed JSON rainbow bracket colors changing across row chunk
boundaries.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-07-23 08:41:26 +00:00
Miguel Raz Guzmán Macedo 6c4b9ae965 Replace panicking unwraps in iterator and Option chains (#61277)
# Objective

Remove `.unwrap()` calls in iterator/`Option` chains that could panic at
runtime.

## Solution

Use `and_then`/`filter_map` with `.ok()` for fallible downcasts
(`entry_view_state.rs`) and keystroke parsing (`vim/command.rs`); use a
descriptive `expect` in `suggest_autoindents` where the invariant is
intentional (`buffer.rs`).

## Testing

- `cargo test -p language buffer` (69 passed)
- `cargo test -p vim command` (26 passed)
- `cargo test -p agent_ui entry_view` (3 passed)

## Self-Review Checklist:

- [x] I have reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-07-23 07:54:43 +00:00
qrzychu 3181085ba2 Fix cursor going to the end of file when LSP formatter uses CRLF line endings (#59151)
I got super annoyed when using Zed with F#, so I fixed it. This also
fixes other LSPs on Windows

Fix is super simple, the test fails if the fix is commented out

Closes #48367 (and probably others)


Release Notes:

- fix cursor jumping to the end of file when LSP formats the file using
CLRF line endings
2026-07-23 07:54:28 +00:00
Tautik AgrahariandKirill Bulatov 756e764b90 project: Track inlay hint / code lens / document symbol registrations by ID (#55340)
extends the precedent set by #43703 (thanks @reflectronic) so that
`textDocument/inlayHint`, `textDocument/codeLens`, and
`textDocument/documentSymbol` correctly track multiple dynamic
registrations by id. previously each register call overwrote the slot on
`ServerCapabilities`, and unregister either silently did nothing
(inlayHint, documentSymbol — no match arm) or wiped the entire
capability (codeLens). now each method keeps its own id-keyed map on
`DynamicRegistrations`; the field on `ServerCapabilities` is cleared
only when the last registration is removed.

textDocument-sync notifications (`didChange`/`didSave`/`willSave`) are
deliberately out of scope — their fan-out semantics are ambiguous in the
spec and were flagged on @smitbarmase's earlier exploration in #36876.

verified with `cargo check -p project -p lsp -p editor`, `cargo test -p
project --test integration -- multi_registration` (3/3 passing), and
`cargo fmt -p project`.

closes part of #37838.

Release Notes:

- Improved support for language servers that dynamically register inlay
hints, code lens, or document symbols multiple times.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-07-23 07:53:30 +00:00
Benjamin YeandKirill Bulatov cfeafdd22a Fix incorrect array merging in LSP initialization_options (#54950)
In lsp_store, user's lsp initialization_options are merged into the
adapter's
defaults using `merge_json_value_into`; this merges by concatenating
arrays,
which can produce duplicate entries.

Adds merge_json_value_into_replacing_arrays, a variant that replaces
arrays instead of merging; uses it for LSP initialization options.
`merge_json_value_into` is kept since some callers intentionally
use array concatenation (extending rust-analyzer's
experimental.commands.commands list).

Closes #54892


Release Notes:

- Fixed duplicated or extra array values in LSP `initialization_options`
when user settings override LSP defaults with an array

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-07-23 07:53:27 +00:00
Eric Holk 63a2ae3eee worktree: Apply outer repository excludes within nested repositories (#61492)
Closes TRA-162

When an entry's ignore stack is rebuilt from scratch (opening a file,
file system events, a search that includes ignored files),
`ignore_stack_for_abs_path` only consulted the `.git/info/exclude` rules
of the nearest ancestor containing `.git`. For a path inside a nested
repository, that nearest ancestor is the nested repository itself, so
the outer repository's exclude rules were silently dropped: entries that
were correctly ignored after the initial scan would flip to unignored
the moment they were loaded or changed on disk, and from then on project
search would surface them.

This is the same class of bug that #60772 fixed for ancestor
`.gitignore` files — this change extends the fix to `info/exclude` by
collecting the exclude rules of every containing repository (outermost
first, mirroring how ancestor gitignores are stacked) instead of just
the innermost one.

Added a regression test that models the affected layout: a bare clone
and a linked worktree of it kept inside the repository, hidden via
anchored patterns in the outer repository's `.git/info/exclude`.

Release Notes:

- Fixed project search returning results from inside nested repositories
that are excluded by the containing repository's `.git/info/exclude`
file.
2026-07-23 07:24:08 +00:00
vinod akshat 81b67f4741 editor: Fix horizontal autoscroll only revealing part of search matches (#61487)
# Objective

- While navigating between search matches with word wrap off via Select
Next match and Select Previous Match, the horizontal autoscroll would
sometimes fail to scroll the viewport enough to show the full searched
word. This happened in both the cases of Previous match and next search
till we had to come to the first appearance of the word.
- Fixes #61409

## Solution

- In `/crates/editor/src/scroll/autoscroll.rs` the function
`autoscroll_horizontally`, the scroll bounds were both being derived
from `selection.head()`, I inferred that head is the position of the
cursor at the end of the selection. But for the correct `start_column`
and `end_column` it needs to depend not just on the cursor at the end.
So rather than using the head for the calculation for both, I have
calculated them using `selection.start` and `selection.end` directly to
display pts.
- Falling back to col 0 or the full line length when the start or end
lies on different row than the current being processed. Now it scrolls
enough to reveal the entire match.

## Testing

- Did you test these changes? If so, how?
1. Ran full tests using `cargo test` on the full repository
2. Manual test present in the showcase section

- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
Disable word wrap, create a file with a short match near the start of a
long unwrapped line and another match further right, search for it, and
use Select Next/Previous Match to jump between them. The full match
should scroll into view each time.

- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
Tested on macOS Tahoe 26.5.2 

## 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
- [ ] Performance impact has been considered and is acceptable

## Showcase



https://github.com/user-attachments/assets/ace25b26-560d-47f1-a905-f04879f23f15



---

Release Notes:

- Fixed horizontal autoscroll not fully revealing search matches when
  navigating between matches with word wrap disabled.
2026-07-23 06:38:04 +00:00
Earthgames 476fb44112 Print Asset Error with the whole context (#61482)
# Objective

So while using gpui I didn't know that you needed to register a
http_client if you wanted to use images with a link as a source.
So I enabled logs, and I did get errors.
```
20:48:11 [ERROR] Failed to load asset2: error: loading image asset from "https://im.fumo.ing/tLNyIY4n7PEG.jpg"
```
But they didn't tell me what was wrong.

## Solution

I change 2 lines to print the whole error with all the context.

```
20:49:09 [ERROR] Failed to load asset2: Other(loading image asset from "https://im.fumo.ing/tLNyIY4n7PEG.jpg"

Caused by:
    No HttpClient available)
```
And now it does tell you why it doesn't work. ✨Amazing✨.

## Testing

Because I did change the traits needed for the AssetLogger I build zed
to check if it didn't break anything. And it build, so it fine I think.

A quick way to test the change in logging is the gpui example
`image_gallery.rs` and commenting the lines 259 & 260
```rust
        #[cfg(not(target_family = "wasm"))]
        {
            let http_client = ReqwestClient::user_agent("gpui example").unwrap();
            cx.set_http_client(Arc::new(http_client));
        }
```
Or change the URI on line 42 to something non existing.

## Self-Review Checklist:

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

Release Notes:

- Improved Error logging for Asset loading
2026-07-23 06:26:38 +00:00
Zeldris d14b9a7c0b docs: Use official brew cask (#61495)
https://formulae.brew.sh/cask/zed
2026-07-23 05:26:09 +00:00
456bbfc649 dev_container: Build the primary compose service when runServices omits it (#61434)
# Objective

- Fix a bug that caused a dev container configuration which used both a
docker-compose file _and_ `runServices` to incorrectly drop the primary
service.

## Solution

- Disclosure: Claude wrote the Rust but I understand the implementation
- Prior to the change, `run_services` was passed unchanged. However, the
dev container CLI adds the primary if it hasn't been specified - [ref
this
code](https://github.com/devcontainers/cli/blob/f683c29f64a20109b4453e5149807e390ff65133/src/spec-node/dockerCompose.ts#L276-L281)

This PR updates Zed to adhere to that behaviour

## Testing

- I tested both manually against a minimal reproduction case, as well as
a live configuration that was the original reason for creating this PR
- I tested this on OS X. While I believe the PR is far enough abstracted
from the platform, it's always possible that Windows is doing something
weird. I don't expect that, however.
- To reproduce either use the following [sample
repo](https://github.com/user-attachments/files/30256541/devcontainer-repro.zip)
or attempt to build a **clean** docker container for a dev container
configuration which utilizes both `runServices` as well as a
`docker-compose.yml` file.

## Self-Review Checklist:

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

Release Notes:

- Dev containers: Fix for docker compose behaviour that caused
`runServices` to not implicitly include the primary service if it wasn't
explicitly listed

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
2026-07-23 05:11:37 +00:00
Ibrahim Khan cbe92a9c1a snippets: Strip path separators from language snippet file names (#61421)
Closes #59620

## Problem

A language whose name contains a `/`, such as a custom `PL/X` extension
(`lsp_id` → `pl/x`), broke snippets end to end:

- The `snippets: configure snippets` action wrote the file to
`~/.config/zed/snippets/pl/x.json`, i.e. inside a `pl/` subdirectory.
- The snippet scanner reads `snippets/` non-recursively and skips
directories, so that file was never loaded and the snippet could never
be used.
- The completion lookup keyed off the raw `lsp_id` (`pl/x`), which
wouldn't have matched the file-stem key even if the file had been
scanned.

So Zed's own UI created a snippet file it could never read back.

## Fix

Add `LanguageName::snippet_scope_id()` (the `lsp_id` with `/` and `\`
removed) and use it everywhere a language maps to its snippet file name
or lookup key:

- the Configure Snippets writer and its "already configured" label, and
- the two completion lookups in `editor`.

`PL/X` now maps to a flat `plx.json`, as suggested in the issue. The
`editor::InsertSnippet` action is intentionally left unchanged: its
`language` field is documented to be the snippet file name stem, which
is already separator-free.

Note: files created under the old behavior (nested `foo/bar.json`)
aren't migrated; re-running Configure Snippets writes the corrected flat
file.

## Testing

- Added a `language_core` unit test asserting `snippet_scope_id()`
strips `/` and `\` (e.g. `PL/X` → `plx`).
- `cargo test -p language_core` passes.
- `./script/clippy -p language_core -p language` passes.
- Docs Prettier passes.

Release Notes:

- Fixed snippets being unusable for languages whose name contains a `/`
character
2026-07-23 04:49:39 +00:00
Finn Eitreim c5be61b3d5 terminal: Actually close process groups when the terminal is closed (#61467)
# Objective

Closes #47412

Currently, processes that ignore SIGHUP/SIGTERM will not be killed when
the terminal is closed or Zed is closed.

## Solution

We need to follow up on the processes to ensure that they have been
properly killed BEFORE zed closes fully. We send SIGTERM then 100ms
later send SIGKILL, this gives programs some time to exit gracefully
before being SIGKILL'd.

## Testing

I tested it by both closing the terminal pane and closing zed
completely, both worked. There is a new test added as well. The best way
to test it is with the reproduction in this comment:

https://github.com/zed-industries/zed/issues/47412#issuecomment-4596563655

I only tested this on MacOS 27. It might be worth testing on linux, but
also mac/linux behavior here should be quite similar. Windows behavior
as well should be unchanged but could be worth testing.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments

Okay there is an unsafe block in this PR, but its just being moved from
one location to another, and it didn't originally have a comment, I
assume because its just a libc call so its pretty clear.

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

## Showcase

Video showcasing the new behavior:


https://github.com/user-attachments/assets/b2b8cb0c-0648-41b4-b940-91c466aeaab3



---

Release Notes:

- Terminal: Prevents processes from being left alive when the terminal
is closed.
2026-07-23 03:47:47 +00:00
John b2f2f8d297 Fix first LSP server item flickering and staying highlighted when hovering between multiple language server entries in the status bar menu (#61400)
# Objective

- When a submenu is open in a ContextMenu (e.g., an LSP server entry in
the status bar menu), focus moves from the main menu to the
submenu entity. Hovering over a different submenu trigger calls
`on_hover(true)` which runs `window.focus()` to return focus to the main
menu. This fires `on_focus_in`, which runs `select_toggled_or_first` →
`select_first`, re-selecting the first item. The same issue occurs
in `on_hover(false)` when the mouse leaves a trigger with an open
submenu.

## Solution

- Add a `suppress_focus_selection` flag to `ContextMenu`. Before each
`window.focus()` call in `on_hover` handlers, set the flag to
`true`. The `on_focus_in` callback checks this flag and skips
auto-selection when focus is returning from submenu interaction. The
flag is
reset to `false` after each `on_focus_in` invocation.

## Testing

- Tested manually by opening the LSP status bar menu with multiple
running language servers and hovering between server entries. The
first item no longer flickers or stays highlighted after hovering over
other items.

## Showcase
### before fixed


https://github.com/user-attachments/assets/26efb133-fb7e-4dbe-88b7-88d510dfd3a4



### after fixed


https://github.com/user-attachments/assets/7081c07d-d7f6-4a35-abe3-486bfba8591f


## Release Notes:
- Fixed a bug where the first LSP server item would flicker and stay
highlighted when hovering between multiple language server entries in
the status bar menu.
2026-07-23 03:38:00 +00:00
zed-zippy[bot] 4ed45d1b9f Bump Zed to v1.14.0 (#61488)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-07-22 23:21:07 +00:00
Cameron McloughlinandMikayla Maki 98e71d9f25 agent: Temporarily remove sandbox feature (#61484)
see title

---

Release Notes:

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

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2026-07-22 22:39:21 +00:00
Finn Evers 7dc8071ac8 Add wrapper type for language servers in settings (#61398)
This is in preparation for making configuration of language servers more
comfortable for users/extensions.

Release Notes:

- N/A
2026-07-22 21:48:46 +00:00
Mohit GoyalandMartin Ye cb68afbd2b Respect disabled trailing whitespace removal (#58776)
Self-Review Checklist:

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

  Closes #58686

Release Notes:

- Fixed `.editorconfig` re-enabling trailing whitespace removal when Zed
settings disable it.

---------

Co-authored-by: Martin Ye <martin@zed.dev>
2026-07-22 21:10:32 +00:00
aa2a4211a3 editor: Treat single punctuation as a word boundary (#58882)
## Context

`next_word_end` and `previous_word_start` have a special case that skips
a punctuation character so that word movement treats the punctuation as
a part of the word (`|.foo` -> `.foo|`). But the check only looked at
whether the next char was punctuation, not whitespace, so it skipped
single punctuation marks.

	foo |. bar -> foo . bar| (should be `foo .| bar`)

Fix: only skip the punctuation when it's next to a word char.

Closes #55601

## How to Review

In any buffer, type `foo . bar`:

- Cursor before `.`, alt-right -> stops after the `.` (`foo .| bar`),
not at the end of `bar`.
- Cursor after `.`, alt-left -> stops before the `.` (`foo |. bar`).

##  Self-Review Checklist

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

Release Notes:

- Fixed word movement skipping single punctuation characters surrounded
by whitespace.

---------

Co-authored-by: Martin Ye <martin@zed.dev>
Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
2026-07-22 21:00:52 +00:00
Apoorva Verma e540e8e488 project: Restart context servers when their working directory changes (#61365)
# Objective

Fixes #60879

Open Zed from Finder/Dock and the agent's MCP servers run from `/`
instead of your project. They get spawned before any worktree exists, so
there's no root to give them and they grab Zed's own cwd. The worktree
shows up right after, but `maintain_servers` only restarts on a config
change and the working dir isn't part of the config, so nothing kicks
it.

## Solution

Track each server's working dir and restart when it changes. Direction 1
from @SomeoneToIgnore's triage. Could also defer startup until the first
worktree lands, happy to switch if you'd rather.

## Testing

Added a test: file-only worktree (root is `None`) → start server → add a
real worktree → server restarts. Fails without the fix.
- Fixed agent MCP servers running from the wrong directory when started
before a worktree was available
2026-07-22 19:45:18 +00:00
ᴀᴍᴛᴏᴀᴇʀ 24058c8659 editor: Fix right-click context menus failing to appear at pixel-snapped scroll positions (#61348)
# Objective

Fixes #56136.

The issue was initially reported while an agent was generating code.
Later reports reproduced it during manual editing and with AI disabled,
ruling out the agent as the cause.

At fractional display scales, the editor's right-click context menu
could fail to appear at specific discrete scroll positions. Scrolling
one line at a time could make the menu alternate between hidden and
visible, even when its anchor remained within the viewport.



## Solution

The editor-specific changes in #54728 started pixel-snapping the
vertical scroll position used by `EditorElement` to derive and render
visible rows. However, `Editor::display_to_pixel_point` continued using
the raw scroll position for its visibility check and vertical
projection.

When a downward pixel snap crossed an integer display-row boundary,
`EditorElement` treated the preceding row as the visible range start.
`display_to_pixel_point` then rejected that row as being above the raw
viewport. Mouse context menu layout returned early before inspecting the
actual clicked anchor, leaving the menu state present without rendering
its element.

This change applies the same line-height and display-scale pixel
snapping in `display_to_pixel_point`. Its visibility check and
coordinate projection now use the coordinate space actually rendered by
the editor.

A test-support-only scale-factor setter was also added so GPUI tests can
exercise fractional display scaling without depending on the host
display.

## Testing

Added a GPUI regression test using 100 plain-text lines so the editor
can scroll. The test uses a `1.25` scale factor and a `14px` font with
`1.3` relative line height. The resulting `18.2px` line height is
rounded to `18px`, producing exactly `22.5` device pixels per row.

At a raw scroll position of one row, midpoint-toward-zero snapping maps
`22.5` device pixels to `22`, or approximately `0.978` rows. This
reproduces the old boundary mismatch where the snapped visible range
starts at row zero while the raw visibility check starts at row one.

The test pins these values with precondition assertions. Row five and an
in-bounds click keep the actual source visible, while checking the
rendered bounds of the `Copy` item ensures the test does not pass merely
because menu state was created.

Manually verified that scrolling from the start of a document no longer
makes the context menu alternate between hidden and visible.

## Self-Review Checklist:

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

## Showcase

Before:


https://github.com/user-attachments/assets/e14c030f-1587-4172-aed2-fecfbfcb65ed


After:



https://github.com/user-attachments/assets/3080db1e-46eb-4e20-a619-b1608f233668



---

Release Notes:

- Fixed editor right-click context menus intermittently failing to
appear at certain scroll positions.
2026-07-22 19:17:25 +00:00
Neel 8265635b6f project: Explicitly scan on git reset and fetch (#60590)
This PR fixes a bug where uncomitting would not reflect changes in the
git panel, and fetching would not update the upstream ahead/behind
counts in the git panel. This was especially evident on Linux which has
non-recursive watches.

---

Release Notes:

- Fixed changes not appearing in the git panel after uncommitting
- Fixed the git panel not updating ahead/behind counts after a fetch
2026-07-22 17:10:58 +00:00
Danilo Leal 208be9b1f6 collab_panel: Adjust list item height across the panel (#61466)
Yet another quick follow up to
https://github.com/zed-industries/zed/pull/61397, making sure the height
of each item is consistent. This is particularly important so that the
tree-connecting-lines that show up when you share a project or screen
don't get disconnected.

Release Notes:

- N/A
2026-07-22 16:57:34 +00:00
Richard Feldman 396cdc37c1 gpui: Defer element arena clears while an enclosing draw is in progress (#60295)
GPUI allocates every element for a draw in a single per-App bump arena,
and `Arena::clear()` assumed no draw was in progress. But draws can
nest: on Windows, the window procedure re-enters whenever the main
thread pumps messages mid-draw (cross-thread `SendMessage` dispatch,
modal message loops entered by COM/OLE calls such as clipboard reads),
and on any platform a draw can be triggered from within another draw
(e.g. `open_window`). When a nested draw finished, its arena clear freed
and rewound memory the outer draw was still using. The `ArenaBox`
validity flag only guards new derefs, so `&mut` references already held
by the outer draw silently pointed into reused memory. That
use-after-free corrupted element-state keys
(`GlobalElementId`/`SharedString` Arcs) and heap metadata, crashing
later in innocent-looking frames — seen in the wild as
`EXCEPTION_ACCESS_VIOLATION_READ / 0xffffffffffffffff` in
`Frame::finish` and element allocation
([ZED-9QN](https://zed-dev.sentry.io/issues/7577818040/),
[ZED-7JC](https://sentry.io/organizations/zed-dev/issues/7465778926/),
[ZED-7C6](https://zed-dev.sentry.io/issues/7460258444/)), plus
occasional "attempted to dereference an ArenaRef after its Arena was
cleared" panics (ZED-96P, ZED-8XN), Windows-dominant and spanning
versions 1.1.7–1.8.2.

The fix makes the arena sound under nesting: `ElementArenaScope` tracks
a scope depth on the arena, and `Arena::clear()` is deferred while any
scope is active — the outermost draw's clear drops both draws'
allocations. Since arena chunks are stable heap blocks and allocation
only appends, nested allocation was already safe; the mid-draw clear was
the only destructive operation. Scopes are ended via a consuming
`exit(arena)` call that asserts arena identity (by pointer comparison,
never dereferencing), and `ArenaClearNeeded::clear(cx)` reaches the
arena through the App, so this bookkeeping contains no unsafe code
beyond what existed before. A panic that unwinds a draw balances the
scope depth in the guard's `Drop`, so later clears still run; only the
unwound draw's own clear token is never produced, leaving the arena
populated until the next draw's clear — a one-frame leak at worst, never
a use-after-free.

Additionally, draws are no longer run re-entrantly: GPUI's
`on_request_frame` callback skips requests that arrive while a draw is
already on the thread's stack (remembering `force_render` for the next
frame), and on Windows a `DrawCoordinator` owned by the platform and
shared with every window additionally guards the wider `draw_window`
span (presentation, IME updates). Deferred windows validate their update
region (so nested message pumps don't busy-loop on WM_PAINT) and are
repainted at most one vsync later by the vsync thread's existing
per-tick invalidation.

An integration test opens a window from within an element's paint;
without the deferred clear it reproduces the exact "ArenaRef after its
Arena was cleared" panic seen in the wild. Deferrals are logged so the
diagnosis can be confirmed from user logs.

Closes FR-110

Closes FR-114

Release Notes:

- Fixed a crash on Windows caused by re-entrant window drawing
corrupting UI element memory.
2026-07-22 15:25:22 +00:00
Vlad Gaevsky 9cbae806f2 editor: Do not reserve inline blame scroll width when blame is in the status bar (#61422)
## Problem

When `git.inline_blame.location` is `status_bar` (anything other than
`inline`), nothing is painted inline at the end of the line — yet the
horizontal scroll range still reserves the longest row's inline blame
width (introduced in #23374), letting the editor scroll into blank space
when a line is long enough to scroll. Reported in #24752 (e.g.
@Nemesis19's comment: still reproduces with `location: status_bar`).

## Fix

Skip the blame width reservation in the scroll range when the blame
location isn't `Inline` — one guard in the `longest_line_blame_width`
closure in `element.rs`. This is independent of the soft-wrap fix for
#24752 (#61319) and can land on its own.

## Test

`test_status_bar_blame_location_reserves_no_scroll_width` asserts that,
with a long line and no soft wrap, moving blame from inline to the
status bar shrinks the horizontal scroll range (the reservation is
dropped). It uses a fixed-width test `BlameRenderer`, since the default
test renderer returns `None` and never exercised the reservation.

Release Notes:

- Fixed inline git blame reserving horizontal scroll space even when
blame is displayed in the status bar
2026-07-22 14:32:56 +00:00
Mahammad NabiyevandKirill Bulatov f555af0236 docs: Add PHPantom language server configuration (#61387)
Adds documentation for **PHPantom**—a fast, Rust-based PHP language
server—as a selectable language server alongside `PhpTools`,
`Intelephense`, and `Phpactor`.

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-07-22 13:46:00 +00:00
Lukas Wirth df5d437085 Disable LSP for files with very long lines (#61447)
Release Notes:

- Fixed ui stutters when opening large single line files like minified
javascript due to running LSP requests against them
2026-07-22 13:25:49 +00:00
Gaauwe Rombouts 45669409fb gpui_web: Support configurable fetch credentials (#61460)
Adds configurable browser Fetch credential handling to `gpui_web`.
`FetchHttpClient` can now use `omit`, `same-origin`, or `include`,
allowing cross-origin WASM requests to send session cookies while
preserving `same-origin` as the default.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-07-22 13:12:36 +00:00
Jakub Konka d5a4de9392 gpui_linux: Fix Wayland serial token tracking (#61454)
Closes #58651 
Closes FR-123

https://github.com/zed-industries/zed/pull/50406/ while fixing one issue
regressed serial tracking in Wayland. What happens is we conflated
unrelated serials into a common value which is wrong. For example,
`InputMethod` serial does not come from the same source as `MousePress`
or `KeyPress`, and if Zed is running for a while and the user performs
lots of IME commits (`zwp_text_input_v3.commit`), `InputMethod` will
overtake other serial values and will be incorrectly used for clipboard
authorisation/selection by the compositor such as Mutter or kWin. This
will effectively poison the clipboard making Zed the indefinite owner
until we kill Zed. More concretely, we use `get_latest()` on the serial
tracker to extract *the largest serial REGARDLESS of kind* which is
wrong since not every serial kind comes from the same pool.

Release Notes:

- Fixed copy-paste behaviour in Wayland.
2026-07-22 12:46:55 +00:00
Om Chillureanddino 52944fa0dd Support loading Git commit templates when remote (#55490)
## Summary

Fixes the git commit template not loading in remote (SSH) projects. The
`load_commit_template_text` method in `git_store.rs` was a no-op for
`RepositoryState::Remote`, always returning `Ok(None)`. This patch adds
a `LoadCommitTemplate` RPC so the client can ask the remote host to read
its `commit.template` git config and return the file contents —
mirroring the existing `GetBlobContent` pattern.

## Changes

- **`crates/proto/proto/git.proto`** — new `LoadCommitTemplate` /
`LoadCommitTemplateResponse` messages.
- **`crates/proto/proto/zed.proto`** — registered envelope IDs 449/450.
- **`crates/proto/src/proto.rs`** — wired up message priority, request
pairing, and entity-message routing.
- **`crates/project/src/git_store.rs`** — added
`handle_load_commit_template` on the host side; replaced the `Ok(None)`
no-op on the remote side with the RPC call.

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments — *no unsafe code
added*
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
— *no UI changes*
- [ ] Tests cover the new/changed behavior — *see "Testing notes" below*
- [x] Performance impact has been considered and is acceptable — *one
extra RPC on commit panel open for remote projects only; payload is a
single optional string*

## Testing notes — why no automated test

I did write an integration test (`test_remote_git_commit_template` in
`collab/tests/integration/git_tests.rs`, modeled after
`test_remote_git_head_sha`) along with the supporting changes to
`FakeGitRepositoryState` (adding a `commit_template` field +
`set_commit_template_for_repo` setter on `FakeFs`, since the fake
hardcoded `load_commit_template` to `None`).

The test compiled and the smaller crates (`fs`, `proto`, `project`)
checked clean, but `cargo test -p collab --test collab_tests`
cold-compile takes a very long time on my machine and I wasn't able to
confirm the test actually passed locally. Rather than push a test I
hadn't seen pass, I removed it. Happy to add it back in a follow-up PR
(or in this one if reviewers prefer) once I can run the collab suite
end-to-end — the diff is small and I can share it on request.

Verification was done end-to-end manually using a Docker dev container
as the SSH remote:

#### Closes #55265

Video : 
[Screencast from 2026-05-02
18-09-03.webm](https://github.com/user-attachments/assets/9cb7f375-57fa-4af3-bde4-871c28f61efc)

Release Notes:
- Added support for loading git commit template messages in both remote
and collab projects.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-07-22 12:01:29 +00:00
Danilo Leal 1f63fef270 git_panel: Adjust commit items in the history tab (#61456)
This PR is super small mostly adjusting a few things in the commit item
within the history tab: author label truncation, tooltip
label/description, and unpushed arrow icon design.

Release Notes:

- N/A
2026-07-22 11:55:43 +00:00
Xiaobo LiuandTom Houlé 0cfa50afdc vim: Set [ and ] marks to paste destination (#56593)
Previously, the `[` and `]` marks always pointed to the yank source
location. After a paste operation, they now correctly point to the start
and end of the pasted text in the destination buffer.

This enables workflows like `v]` to select just-pasted text, and fixes
the `gp` keymap pattern shown in the issue.


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

Release Notes:

- vim: Made `[` and `]` marks point to the start and end of pasted text
after a paste operation.

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Tom Houlé <tom@tomhoule.com>
2026-07-22 11:37:17 +00:00
Danilo Leal 4a039eac0c collab_panel: Adjust pressed state of the channel item (#61453)
Yet another follow up to
https://github.com/zed-industries/zed/pull/61423 simplifying the design
even further.

Release Notes:

- N/A
2026-07-22 11:23:30 +00:00
Jiaxiang Zhang 859a63ef2d Set the default value of tsserver to 8 GiB instead of 7.9 GiB (#61406)
Correct memory values: 8 GiB limit (8192) and tsserver max memory set to
16384 for TypeScript and JavaScript examples.

# Objective

- Standardized memory values.

## Testing

- This commit not be tested.

## Self-Review Checklist:

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

Release Notes:

- N/A
2026-07-22 10:20:23 +00:00
Nitin Krishna MucheliandClaude Opus 4.6 a56f9e6eae Remove stale musl linker error workaround from Linux dev docs (#61444)
# Objective

- The Linux dev docs document a workaround for a musl/aws-lc-rs linker
error (`undefined reference to __isoc23_sscanf` / `__isoc23_strtol`)
that no longer applies now that the root cause is fixed.

## Solution

- #61203 fixed the underlying issue directly in `script/bundle-linux` by
setting `CC_<target>=musl-gcc` when building the musl `remote_server`
target, so the documented workaround
(`REMOTE_SERVER_TARGET=x86_64-unknown-linux-gnu`) is stale and
misleading. This PR removes it.

## Testing

- Did you test these changes? If so, how? — Confirmed the removed note
referenced the exact linker error fixed by #61203, and that no other
docs reference the removed workaround.
- Are there any parts that need more testing? — No, this is a docs-only
removal.
- How can other people (reviewers) test your changes? Is there anything
specific they need to know? — Review the diff; confirm
`script/install-linux` no longer hits this error after #61203.
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test? — N/A, docs-only change.

## 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:
- N/A

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-22 10:04:12 +00:00
Nitin Krishna MucheliandClaude Opus 4.6 a705ed4eff Fix musl linking failure in bundle-linux by setting CC for musl target (#61203)
Fixes https://github.com/zed-industries/zed/issues/24880 

# Objective
"Assisted/analysed by AI"
> The remote_server musl build failed with undefined references to
__isoc23_sscanf and __isoc23_strtol from aws-lc-sys because the default
C compiler used glibc headers while linking against musl libc. Setting
CC_<target>=musl-gcc ensures C dependencies compile with musl headers.

I have tested the fix, and it seems to have fixed the compilation issue
I faced on Fedora 44, without resorting to the [hack noted in
docs](https://zed.dev/docs/development/linux#installing-a-development-build).
Initially reported in this
[issue](https://github.com/zed-industries/zed/issues/24880).

I'd want someone with expertise in the domain to take a look at this
fix, as from what I understand, the process in the doc is a hacky
workaround.

## Solution

Setting CC_<target>=musl-gcc ensures C dependencies compile with musl
headers.

## Testing

- Did you test these changes? If so, how?

    <details><summary>Here's my steps to repro:</summary>
1. install [toolbox](https://github.com/containers/toolbox) (or
podman-toolbox)
(I used toolbox as it's easy to reuse the cloned repo, as the whole home
dir is mounted in the devcontainer)
Used the main branch - commit c3027f441c
    2. toolbox create -d fedora -r 44
    3. toolbox enter fedora-toolbox-44
    4. then run the `scripts/linux` script to install prereqs
5. try compiling remote-server using the commands in
`scripts/install-linux` (I just ran the script wholly)
    
    LDD version:
    ```
    ⬢[root@toolbox zed]# ldd --version
    ldd (GNU libc) 2.43
    ```
    
    GCC/MUSL versions:
    ```
    musl-gcc  : 1.2.5
    gcc : 16.1.1
    ```
    
    Error:
    ```
    error: linking with `cc` failed: exit status: 1
      |
= note: "cc" "-m64"
"<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/rcrt1.o"
"<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crti.o"
"<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtbeginS.o"
"<747 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic"
"/root/zed/target/x86_64-unknown-linux-musl/release/deps/rustceHhjo8/{libzstd_sys-5c3eb6739555ecf4,libtree_sitter_json-ad90c8af7e8a3750,libtree_sitter-f91a92b688e12e56,libwasmtime-decd3377028506ce,libaws_lc_sys-a051f708b6dafc2a,libring-fcc1b43e3092bc93,libpsm-d967f50c6f2b67a4}.rlib"
"-lunwind" "-lc"
"<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-*.rlib"
"-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/deps/rustceHhjo8/raw-dylibs"
"-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack"
"-nostartfiles" "-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/build/psm-dc603221f407eabc/out"
"-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/build/tree-sitter-28f7b87c1db3fab9/out"
"-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/build/wasmtime-f0bb0950e09a7352/out"
"-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/build/aws-lc-sys-2a7ca8eafafe18fa/out"
"-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/build/ring-d7857a166bac60a6/out"
"-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/build/zstd-sys-0e04609af7157148/out"
"-L"
"/root/zed/target/x86_64-unknown-linux-musl/release/build/tree-sitter-json-b1e2eeaba7bbb519/out"
"-L"
"<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained"
"-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib" "-o"
"/root/zed/target/x86_64-unknown-linux-musl/release/deps/remote_server-3782b255c59d4e14"
"-Wl,--gc-sections" "-static-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1"
"-nodefaultlibs" "-Wl,--disable-new-dtags,-rpath,$ORIGIN/../lib"
"<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtendS.o"
"<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtn.o"
= note: some arguments are omitted. use `--verbose` to show all linker
arguments
= note: /usr/bin/ld.bfd:
/root/zed/target/x86_64-unknown-linux-musl/release/deps/rustceHhjo8/libaws_lc_sys-a051f708b6dafc2a.rlib(f8e4fd781484bd36-bcm.o):
in function `aws_lc_0_40_0_handle_cpu_env':

/aws-lc/crypto/fipsmodule/cpucap/cpu_intel.c:(.text.aws_lc_0_40_0_handle_cpu_env+0x63):
undefined reference to `__isoc23_sscanf'
/usr/bin/ld.bfd:
/root/zed/target/x86_64-unknown-linux-musl/release/deps/rustceHhjo8/libaws_lc_sys-a051f708b6dafc2a.rlib(f8e4fd781484bd36-bcm.o):
in function `pkey_rsa_ctrl_str':

/aws-lc/crypto/fipsmodule/evp/p_rsa.c:692:(.text.pkey_rsa_ctrl_str+0x222):
undefined reference to `__isoc23_strtol'
/usr/bin/ld.bfd:
/aws-lc/crypto/fipsmodule/evp/p_rsa.c:703:(.text.pkey_rsa_ctrl_str+0x261):
undefined reference to `__isoc23_strtol'
              collect2: error: ld returned 1 exit status
              
= note: some `extern` functions couldn't be found; some native libraries
may need to be installed or have their path specified
      = note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native
libraries to link with Cargo (see
https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
    
error: could not compile `remote_server` (bin "remote_server") due to 1
previous error
    ```
    </details>

- Are there any parts that need more testing?  -- Maybe
- How can other people (reviewers) test your changes? Is there anything
specific they need to know? -- Steps listed above
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test? -- Fedora 44

## Self-Review Checklist:

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

## Showcase

> This section is optional. If this PR does not include a visual change
or does not add a new user-facing feature, you can delete this section.

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

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

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

My super cool demos here

</details>

---

Release Notes:

- Fixed musl error when building remote server from source for the
default musl triple on Linux

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-22 09:37:55 +00:00
Smit Barmase 1cd105ee93 markdown_preview: Fix relative links in remote Markdown subfolders (#61438)
Closes #58270

In remote projects, Markdown previews resolved relative links from the
project root instead of the Markdown file's folder. Links worked for
files in the root but could fail or open the wrong file for files in
subfolders.

Zed now resolves these links from the Markdown file's folder. The fix
updates base path handling in `open_url_or_file`. Only Markdown Preview
passes a base path to this function.

I tested it on macOS with a Linux SSH host and on Windows with WSL.

Release Notes:

- Fixed relative links in Markdown previews for files in subfolders when
using SSH or WSL.
2026-07-22 09:10:58 +00:00
Ruslan Semagin 185c6986da Add gutter action to clear run status (#61375)
# Objective

Add a way to manually clear completed run statuses from the gutter.

Folow-up to #61095 

This follows up on feedback from the previous gutter run status PR.
Currently, editing a file clears run statuses automatically, but there
was no direct way to clear a completed status without changing the file.

## Solution

- Added a `Clear Run Status` entry to the gutter context menu.
- Show the entry only when the row has a completed run status.
- Clear the stored run status for that runnable when selected.
- Keep running statuses unchanged, so this does not behave like task
cancellation.

## Testing

- Ran `cargo check -p editor`.
- Manually ran a test from the gutter and waited for a completed status.
- Verified right-clicking the gutter icon shows `Clear Run Status`.
- Verified selecting `Clear Run Status` clears the status icon.
- Verified the action is not shown for rows without a completed run
status.

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


[after.webm](https://github.com/user-attachments/assets/1ae284e1-03b1-4842-a63e-9d66c290b325)

---

Release Notes:

- Improved gutter run statuses by allowing completed statuses to be
cleared from the gutter context menu.
2026-07-22 09:03:13 +00:00