Commit log

c59af48 agent: Fix issue where created file is not deleted after rejecting (#51745)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

a3a28ea agent_ui: Fix send failure for pasted file#line mention links (#49786)

Click to expand commit body
Release Notes:

- Fixed send failure for pasted file#line mention links


Handle `MentionUri::Selection` with a file path in
`confirm_mention_for_uri`
by resolving it to text content via existing line-range loading logic,
instead
of returning "Unsupported mention URI type for paste".

Keep untitled-buffer selections (`abs_path: None`) as an explicit
unsupported
error for now.

Add a regression test for pasting selection mentions to ensure they
resolve to
`Mention::Text` with the expected line range.

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>

Xiaobo Liu created

1f442da vim: Fix Helix mode subword motions to select traversed text (#45760)

Click to expand commit body
Update Helix's handling of the following actions in order to ensure that
selections are created when using subword motions:

* `vim::NextSubwordStart`
* `vim::NextSubwordEnd`
* `vim::PreviousSubwordStart`
* `vim::PreviousSubwordEnd`

The handling of these motions was done by
`vim::helix::Vim::helix_move_and_collapse`, which simply moved the
cursor without doing any selection. This commit updates it to correctly
use both `vim::helix::Vim::helix_find_range_forward` and
`vim::helix::Vim::helix_find_range_backward`.

The added tests have been confirmed against Helix's behavior of the following commands:

* `move_next_sub_word_start`
* `move_prev_sub_word_start`
* `move_next_sub_word_end`
* `move_prev_sub_word_end`

Closes #41767

Release Notes:

- Fix subword motions in Helix mode to select traversed text

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>

Max Malkin , Conrad Irwin , and dino created

e67cf99 Add remote hostname to title bar project picker tooltip (#51616)

Click to expand commit body
Having multiple remote hosts with long project names makes the project
picker tricky to use.

Added the remote hostname to the tooltip to avoid guessing.

**truncated project + hostname (no change)**
<img width="426" height="368" alt="Screenshot 2026-03-15 at 12 16 29 PM"
src="https://github.com/user-attachments/assets/7b6b732e-cf3c-42c7-9912-1a69ee58b60e"
/>


**hostname in tooltip (multiline)**
<img width="495" height="366" alt="Screenshot 2026-03-15 at 12 16 56 PM"
src="https://github.com/user-attachments/assets/77b60b3a-b8c0-4088-b3c2-3c105a097720"
/>

**hostname in tooltip (single line)**
<img width="426" height="366" alt="Screenshot 2026-03-15 at 12 17 15 PM"
src="https://github.com/user-attachments/assets/baf4d4bd-2724-4a3e-ab29-39ff714fec0e"
/>


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

Release Notes:

- Add remote hostname to title bar project picker tooltip.

Co-authored-by: Amp <amp@ampcode.com>

Casey Watson and Amp created

a777605 Use split token display for xAI models (#48719)

Click to expand commit body
### Split token display for xAI

Extends the split input/output token display (introduced in #46829 for
OpenAI) to all xAI models.

Instead of the combined `48k / 1M` token counter, xAI models now show:
- **↑** input tokens used / input token limit
- **↓** output tokens used / output token limit

#### Before

<img width="513" height="128" alt="Screenshot 2026-02-08 at 11 07 13 AM"
src="https://github.com/user-attachments/assets/14e5cb4a-9b5c-4081-bbfb-407a737bf234"
/>


#### After

<img width="610" height="126" alt="Screenshot 2026-02-08 at 11 05 36 AM"
src="https://github.com/user-attachments/assets/92396dcb-8905-4f87-9b9e-d8b0f63225ba"
/>


#### Changes

- **x_ai.rs** — Override `supports_split_token_display()` to return
`true` on `XAiLanguageModel`. All built-in Grok models already implement
`max_output_tokens()`, so no additional plumbing was needed.
- **cloud.rs** — Add `XAi` to the `matches!` pattern in
`CloudLanguageModel::supports_split_token_display()` so cloud-routed xAI
models also get the split display.

#### Tests

- `test_xai_supports_split_token_display` — Verifies all built-in Grok
model variants return `true` for split token display.
- `test_xai_models_have_max_output_tokens` — Validates all built-in Grok
models report `max_output_tokens` that is `Some`, positive, and less
than `max_token_count` (required for the UI to compute the input token
limit).
- `test_split_token_display_supported_providers` — Confirms the cloud
provider match pattern includes `OpenAi` and `XAi` while excluding
`Anthropic` and `Google`.

Release Notes:

- Changed the display of tokens for xAI models to reflect the
input/output limits.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

Anil Pai , Ben Brandt , and Smit Barmase created

a80b019 ollama: Don't override model's default stop tokens (#48119)

Click to expand commit body
## Summary

When no stop tokens are provided, Zed was sending an empty array
(`"stop": []`) to Ollama. This caused Ollama to override the model's
default stop tokens (defined in its Modelfile) with nothing, resulting
in models like rnj-1:8b generating infinitely with literal stop tokens
appearing in the output.

## Problem

Models with custom stop tokens in their Modelfile (like `<|eot_id|>` for
rnj-1:8b) would generate forever because:

1. Agent thread creates request with `stop: Vec::new()` (empty)
2. Ollama provider converts this to `stop: Some(vec![])`
3. Serializes as `"stop": []` in JSON
4. Ollama interprets this as "override default stop tokens with nothing"
5. Model generates forever, outputting stop tokens as literal text

## Solution

1. In `crates/language_models/src/provider/ollama.rs`:
   - Only send `stop` when explicitly provided
   - When empty, use `None` so the field is omitted from JSON
   
2. In `crates/ollama/src/ollama.rs`:
- Add `#[serde(skip_serializing_if = "Option::is_none")]` to all
`ChatOptions` fields
   - Ensures `None` values are omitted, not serialized as `null`

## Testing

Added 4 new tests in `crates/ollama/src/ollama.rs`:
- `test_chat_options_serialization`: Verifies None fields are omitted
- `test_chat_request_with_stop_tokens`: Verifies stop tokens are
serialized when provided
- `test_chat_request_without_stop_tokens_omits_field`: Verifies empty
stop is omitted

All 11 ollama tests pass, plus 1 language_models ollama test.

Fixes #47798

Release Notes:

- Fixed Ollama models with custom stop tokens generating infinitely by
not overriding model defaults when no stop tokens are specified.

little Kitchen created

905d28c Add stream_options.include_usage for OpenAI-compatible API token usage (#45812)

Click to expand commit body
## Summary

This PR enables token usage reporting in streaming responses for
OpenAI-compatible APIs (OpenAI, xAI/Grok, OpenRouter, etc).

## Problem

Currently, the token counter UI in the Agent Panel doesn't display usage
for some OpenAI-compatible providers because they don't return usage
data during streaming by default. According to OpenAI's API
documentation, the `stream_options.include_usage` parameter must be set
to `true` to receive usage statistics in streaming responses.

## Solution

- Added StreamOptions struct with `include_usage` field to the open_ai
crate
- Added `stream_options` field to the Request struct
- Automatically set `stream_options: { include_usage: true }` when
`stream: true`
- Updated edit_prediction requests with `stream_options: None`
(non-streaming)

## Testing

Tested with xAI Grok models - token counter now correctly shows usage
after sending a message.

## References

- [OpenAI Chat Completions API -
stream_options](https://platform.openai.com/docs/api-reference/chat/create#chat-create-stream_options)
- [xAI API Documentation](https://docs.x.ai/api)

Elier created

8a25373 agent: Save threads before closing them (#51744)

Click to expand commit body
Closes #46078

When we unloaded sessions, we weren't necesarily making sure we had
saved the current state. Now we save it whenever we remove it from the
session map.

Release Notes:

- Agent: Fix cases where thread state wasn't saved before closing the
thread.

Ben Brandt created

4bc324c copilot: Clear completions upon discard (#40185)

Click to expand commit body
Closes #37836

This behavior was already fixed for Supermaven in #37047, but is still
present in Copilot. What's actually happening:
- Receive a multi-line edit prediction
- Dismiss it with escape
- Clicking anywhere in the editor below the cursor calls
`Editor::select` which starts out by calling `Editor::hide_context_menu`
-> `Editor::update_visible_edit_prediction`, bringing back the
prediction that was just dismissed and updating the editor's display map
- The subsequent selection logic in `Editor::select` now operates using
a display map that is inconsistent with what the user saw when clicking
- If the click was anywhere where the prediction inlay used to be,
`Editor::select` thinks the user clicked on the inlay and does nothing,
and the inlay reappears
- If the click was below where the prediction inlay used to be, the
inlay is immediately removed again but the cursor is moved to the wrong
position because the inlay temporarily added a vertical offset to all
lines after it in the buffer

Ultimately, `Editor::select` should be handling the user input using the
same display map that the user saw when making the input. This can
obviously be solved in multiple ways, I chose to clear the current
completions in `CopilotCompletionProvider::discard` such that any
subsequent calls to `Editor::update_visible_edit_prediction` doesn't
immediately nullify the dismissal of the edit prediction by the user.

Note that this also changes the behavior that occurs after dismissing an
edit prediction, moving to a different position in the buffer, and then
returning: currently, this resurfaces the dismissed edit prediction
(which the `test_copilot` test exercises), and after this change it
doesn’t. This current behavior didn't seem desirable to me because it
doesn't happen when using Zeta or Supermaven, but if we want to keep it,
then we could fix the incorrect selection behavior some other way.

Release Notes:

- Fixed bug that resurfaced dismissed Copilot edit predictions when
moving the cursor around

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>

Tim Vermeulen , Piotr Osiewicz , and Ben Brandt created

4e9ffa3 markdown_preview: Add ScrollToTop and ScrollToBottom actions (#50460)

Click to expand commit body
Add `gg`/`G` (vim), `cmd-up`/`cmd-down` (macOS), and
`ctrl-home`/`ctrl-end` (Linux/Windows) keybindings to scroll to the top
and bottom of the markdown preview.

The markdown preview already has page scroll (`ctrl-d`/`ctrl-u`), line
scroll (`ctrl-e`/`ctrl-y`), and item scroll (`alt-up`/`alt-down`) but
was missing top/bottom navigation. This adds two new actions —
`ScrollToTop` and `ScrollToBottom` — using the existing
`ListState::scroll_to()` infrastructure, following the same pattern as
the other scroll actions.

- [x] Done a self-review taking into account security and performance
aspects

Release Notes:

- Added scroll-to-top and scroll-to-bottom keybindings for markdown
preview (`gg`/`G` in vim mode, `cmd-up`/`cmd-down` on macOS,
`ctrl-home`/`ctrl-end` on Linux/Windows)

andrew j created

5eb4d33 Add deleted color to project panel (#51553)

Click to expand commit body
When a file is deleted, the parent folder isn't colored which makes it
hard to know unless we look at the Git Panel.

This PR adds `Color::Deleted` to fix that.

<img width="366" height="428" alt="Screenshot 2026-03-14 at 7 56 04 PM"
src="https://github.com/user-attachments/assets/6ed3a3c7-e7e7-4b48-b89c-705a7c1ff634"
/>

Release Notes:

- Improved project panel to color folder with deleted file

Vinh Tran created

dbe3cc7 Add `xcodebuild -runFirstLaunch` fallback for Metal toolchain installation documentation (#51631)

Click to expand commit body
When setting up on macOS 26, `xcodebuild -downloadComponent
MetalToolchain` can fail if Xcode hasn't been initialized yet. Running
`xcodebuild -runFirstLaunch` first resolves this.

Release Notes:

- N/A

Joey Carpinelli created

5d7e10e search: Fix project search tooltip keybinding hint disappearing (#51568)

Click to expand commit body
What
---
The keybinding hint in the Project Search status bar button tooltip
disappears shortly after the tooltip appears, while the label "Project
Search" remains. This is most reproducible with no file open.

Why
---
`SearchButton` used `Tooltip::for_action` with no stored focus handle,
so `KeyBinding::render` called `window.focused(cx)` at render time to
resolve the `pane::DeploySearch` binding. When the `Tooltip` entity
re-rendered (it subscribes to theme settings changes) and the focused
element was no longer in a `Pane` key context, the keybinding lookup
failed silently and the shortcut hint vanished.

Fix
---
Store the active pane item's `FocusHandle` in `SearchButton` via
`set_active_pane_item` and use `Tooltip::for_action_in` so the
keybinding is always resolved against a stable `Pane` context. Falls
back to `Tooltip::for_action` when no pane item is active.

Closes #51562

Test Plan
---

- [x] `cargo fmt --check`
- [ ] `cargo test --workspace`
   - currently blocked by an unrelated compile error test 
- tests::test_terminal_kill_allows_wait_for_exit_to_complete ... FAILED
- [x] Manual verification of:
- Try to reproduce the issue and the keyboard shortcut visible for as
long as the cursor is hovering over the button.
   
Release Notes
- Fixed Project Search status bar button tooltip keybinding hint
disappearing while hovering

Screenshots
---
Current:
<img width="835" height="496" alt="image"
src="https://github.com/user-attachments/assets/cb1ffdf2-7733-47f6-9030-041459c2734c"
/>

Expected:
<img width="835" height="496" alt="image"
src="https://github.com/user-attachments/assets/84cb54b9-290c-4210-b86b-7ae9f8bf9ac0"
/>

Release Notes:

- N/A

Suphachai Phetthamrong created

a883875 sidebar: Fix subagent threads showing up (#51739)

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

Release Notes:

- N/A

Bennet Bo Fenner created

d84254e agent_servers: Move agent_id constants to agent_servers crate (#51738)

Click to expand commit body
Release Notes:

- N/A

Ben Brandt created

4a3f891 editor: Add an option to disable the formatter (#48991)

Click to expand commit body
Related issue #48600, following #48904

Setting `"formatter": null` does not actually disable the formatter, as
it is functionally equivalent to leaving the setting undefined. In this
case, Zed falls back to the default behavior—either "auto" or a specific
language server, depending on the language.

This PR adds a "none" option to the formatter setting, allowing users to
explicitly disable formatting while keeping `code_actions_on_format`
enabled separately.
```json
"formatter": "none"
```

I still have some doubts about the necessity of this setting itself, but
if it is a desired addition, I will update the documentation
accordingly. If not, please feel free to close this PR.

- [x] Tests or screenshots needed?
- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- Added `"formatter": "none"` in settings to explicitly disable the
formatter.

Xin Zhao created

2714e6e Use proper coodrinates when dealing with runnable ranges (#51735)

Click to expand commit body
Follow-up of https://github.com/zed-industries/zed/pull/51299
Closes ZED-5TK

Release Notes:

- N/A

Kirill Bulatov created

97049a7 gpui_macos: Fix deadlock during re-entrant key status changes (#51035)

Click to expand commit body
Closes #50151

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

Release Notes:

- Fixed a deadlock that froze the entire app when opening a new window
from a PopUp window or switching focus between multiple windows on
macOS.

João Soares created

f1e7f39 project: Fix empty files not downloading from a remote project (#51571)

Click to expand commit body
- check `content_size==0`
- entry is removed from `downloading_files`
- empty file is writte via `smol::fs::write(..., &[])`

this means the receiver handles the empty files completely as soon as
the State message arrives, without ever needing a Chunk that will never
come

Closes #51551

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] No UI CHANGES


Release Notes:
- Fixed empty files not downloading from a remote project

Amaan created

5b6201d languages: Fix semantic tokens for Go (#51621)

Click to expand commit body
Closes #51620

gopls requires more specific initialization for semantic tokens that
other language-servers for reasons that aren't entirely clear to me, it
is however a small fix to make it work. still trying to track down other
malfunctioning language servers in the semantic token realm, so if you
have suggestions let me know.

original behavior (on nightly v0.229):
<img width="1784" height="1123" alt="nightly_behavior"
src="https://github.com/user-attachments/assets/5d976b34-2720-425c-8617-800291862909"
/>

updated behavior:
<img width="1784" height="1124" alt="fix_applied"
src="https://github.com/user-attachments/assets/17c528b9-fea8-4309-9306-44673afc9fc3"
/>

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

Release Notes:

- gopls: fixed semantic token support with gopls.

Finn Eitreim created

b9dce95 gpui(web): Pass events to input handlers and handle IME composition (#50437)

Click to expand commit body
Currently the web backend for gpui doesn't send any events to the
`InputHandler`'s like `EntityInputHandler` which are needed for the
input example and the editor crate, among others. This PR makes it pass
those events, in addition to also dealing with composition events so
that IME works. It adds an invisible input element to listen for
composition events, since canvases don't receive them.

Release Notes:

- N/A

Owen Law created

0895125 lsp: Display readable gopls version in UI (#49835)

Click to expand commit body
Closes #49757
|Before|After|
|--|--|
|<img width="2776" height="218" alt="CleanShot 2026-02-22 at 17 43
16@2x"
src="https://github.com/user-attachments/assets/1ea30418-b192-4a6f-ba11-41d5728a1645"
/>|<img width="814" height="232" alt="CleanShot 2026-02-22 at 17 42
21@2x"
src="https://github.com/user-attachments/assets/ac1637fa-1c97-47e2-90e7-00f68b58345f"
/>|

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

Release Notes:

- Fixed gopls version display showing raw JSON instead of readable
version number

ᴀᴍᴛᴏᴀᴇʀ created

cd1211f git_ui: Fix select previous selects a non-visible item (#49289)

Click to expand commit body
This PR fixes that when you are below a header and want to select a
previous item, we would select a non-visible item because we did a -1 of
the newly selected index, which could end up inside a collapsed
directory.

**Note**: This is only an issue for the git tree view mode.

**Before** (See selection is not visible anymore after select previous,
because it's inside the collapsed directory)


https://github.com/user-attachments/assets/bd032768-b947-45f8-b5a1-6185010202cf

**After** (See selection now selects the first visible item in the list
which is the collapsed directory)


https://github.com/user-attachments/assets/47f67237-be7c-4ef5-8b99-6a3a2b016086

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

Release Notes:

- Git UI: Fix selecting previous item would select a non-visible item if
it's inside a collapsed directory

Remco Smits created

94400d8 keymap_editor: Fix default binding deletion and override (#50699)

Click to expand commit body
## Summary

Fixes #48725

When using the keymap editor to delete or re-bind default keybindings,
two issues caused stale entries to persist:

- **Deleting a default binding** created a `NoAction` suppression entry
in `keymap.json` (correct for GPUI-level suppression), but the keymap
editor displayed it as a phantom `<null>` row alongside the greyed-out
default. Searching by keystroke showed both entries, and clash detection
counted the phantom as a real binding.

- **Changing a default binding's keystroke** (e.g. `⌥⌘T` → `⇧⌃⌘T`) added
the new binding but never suppressed the original default under the old
keystroke. The old default continued appearing in keystroke searches and
clash warnings.

## Fix

1. **Filter `NoAction` suppression bindings from the keymap editor
display.** These remain in the internal binding list for conflict
detection (so overridden defaults are still correctly greyed out), but
are excluded from the visible match results.

2. **Append a `null` suppression for the old keystroke when replacing a
non-user binding with a different keystroke.** When `update_keybinding`
converts a `Replace` to `Add` for a non-user binding and the keystroke
changes, it now also writes `{"old-keystroke": null}` (with the original
context) to suppress the stale default.

## Reproduction steps (verified fixed)

1. Open the keymap editor
2. Click Search by Keystroke and press `⌥⌘T`
3. You should see "agent: new thread" and "pane: close other items"
(both Default)
4. Right-click "agent: new thread" and choose Delete
5. Double-click "pane: close other items", change keystroke to `⇧⌃⌘T`,
click Save
6. Verify no `<null>` phantom row appears, and no stale defaults remain
under `⌥⌘T`
7. Close and reopen the keymap editor, search `⌥⌘T` — no results
8. Search for "editor: wrap selections in tag" and assign `⌥⌘T` — no
clash warnings

## Test plan

- [x] Existing `keymap_update` and `test_keymap_remove` tests pass
- [x] Added test: replacing a non-user binding **without** changing the
keystroke produces no suppression
- [x] Added test: replacing a non-user binding **with** context and
keystroke change produces a suppression that preserves the context
- [x] Manual verification of all reproduction steps above

Release Notes:

- Fixed an issue with the keymap editor where where the defaults would not be completely removed when deleting or overriding default keybindings

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>

iam-liam and Ben Kunkle created

f3fb4e0 Reject shell substitutions in terminal tool commands (#51689)

Click to expand commit body
Harden the terminal tool's permission system to reject commands
containing shell substitutions and interpolations (`$VAR`, `${VAR}`,
`$(…)`, backticks, `$((…))`, `<(…)`, `>(…)`) before they reach terminal
creation.

## Changes

### Shell command parser (`shell_command_parser`)
- Added structured terminal command-prefix extraction with env-var
prefix support
- Added parser-backed validation that classifies commands as
Safe/Unsafe/Unknown
- Extended normalized command extraction to include scalar env-var
assignments in order
- Preserved quoted assignment values when they contain whitespace or
special characters

### Pattern extraction (`agent/pattern_extraction`)
- Updated terminal pattern extraction to use structured parser output
- Included env-var prefixes in generated allow patterns
- Normalized regex token boundaries to `\s+` while preserving display
whitespace

### Tool permissions (`agent/tool_permissions`)
- Added invalid-terminal-command rejection for forbidden
substitutions/interpolations
- Added unconditional allow-all bypass (global default Allow, or
terminal-specific Allow with empty patterns)
- Preserved hardcoded denial precedence over allow-all

### Terminal tool (`agent/tools/terminal_tool`)
- Updated tool description and input schema to explicitly prohibit shell
substitutions
- Added comprehensive SEC-264 regression test suite (20 new tests)
covering:
- All forbidden constructs (`${HOME}`, `$1`, `$?`, `$$`, `$@`,
`$(whoami)`, backticks, `$((1+1))`, `<(ls)`, `>(cat)`, env-prefix
variants, multiline, nested)
  - Allow-all exception paths (global and terminal-specific)
  - Hardcoded-denial precedence
- Env-prefix permission flow (matching, value mismatch rejection,
multiple assignments, quoted whitespace)

Closes SEC-264

Release Notes:

- Terminal tool permissions regexes can now match environment variables
(e.g. `FOO=bar cmd arg1 arg2`)
- If terminal tool permissions have active permissions regexes running
on them, then bare interpolations like `$FOO` are disallowed for
security, since regexes wouldn't be able to match on them.

Richard Feldman created

977cd6a Move sidebar back out of the panel (#51723)

Click to expand commit body
Reverts https://github.com/zed-industries/zed/pull/51241

Release Notes:

- N/A

Max Brunsfeld created

7788784 Fix "Show Edit Predictions For This Buffer" button (#50845)

Click to expand commit body
Closes #48393

When switching the language of an unsaved buffer (e.g., from Plain Text
to JavaScript), the editor's edit_prediction_settings were not
recalculated. This caused the "This Buffer" toggle in the edit
prediction menu to show a stale state, making the first click a no-op. I
added a call to update_edit_prediction_settings in the LanguageChanged
event handler so the editor immediately reflects the correct edit
prediction state for the new language.

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

Release Notes:

- Fixed the "Show Edit Predictions For This Buffer" toggle being a no-op
in unsaved buffers after switching the buffer's language.

Ayush Kumar Anand created

f7ec531 worktree: Fix binary files misdetected as UTF-16 (#50890)

Click to expand commit body
Closes #50785

Opening a .wav file (PCM 16-bit) caused Zed to freeze because the binary
detection heuristic in `analyze_byte_contentmisidentified` it as
UTF-16LE text. The heuristic determines UTF-16 encoding solely by
checking whether null bytes are skewed toward even or odd positions. PCM
16-bit audio with small sample values produces bytes like `[sample,
0x00]`, creating an alternating null pattern at odd positions that is
indistinguishable from BOM-less UTF-16LE by position alone.

### Why not just add more binary headers?

The initial approach
(https://github.com/zed-industries/zed/commit/32d8bd700943ae7cb46231bc08d752d8b7987432)
was to add audio format signatures (RIFF, OGG, FLAC, MP3) to known
binary header. While this solved the reported `.wav` case, any binary
format containing small 16-bit values (audio, images, or arbitrary data)
would still be misclassified. Adding headers is an endless game that
cannot cover unknown or uncommon formats.

### Changes

* Adds `is_plausible_utf16_text` as a secondary validation: when the
null byte skew suggests UTF-16, decode the bytes and count code units
that fall in C0/C1 control character ranges (U+0000–U+001F,
U+007F–U+009F, excluding common whitespace) or form unpaired surrogates.
Real UTF-16 text has near-zero such characters. I've set the threshold
at 2% — note that this is an empirically derived value, not based on any
formal standard.

**Before fix**

<img width="1147" height="807" alt="스크린샷 2026-03-06 오후 9 00 07"
src="https://github.com/user-attachments/assets/2e6e47f9-f5e7-4cab-9d41-cc3dd20f9142"
/>

**After fix**
<img width="1280" height="783" alt="스크린샷 2026-03-06 오전 1 17 43"
src="https://github.com/user-attachments/assets/3fecea75-f061-4757-9972-220a34380d67"
/>


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

Release Notes:

- Fixed binary files (e.g. WAV) being misdetected as UTF-16 text,
causing Zed to freeze.

Lee ByeongJun created

74ad758 keymap_editor: Remove redundant parentheses when displaying keymap context (#50906)

Click to expand commit body
Closes #34976

## Root Cause

The current implementation of `fmt::Display` in
`KeyBindingContextPredicate` hardcodes a parentheses around `And` and
`Or` cases. Causing the text displayed on the keymap editor to have
nested parentheses.

This PR refactors the display logic and make the parentheses added only
when there's nested operator.

## As is/ To be

As is | To be
--- | ---	
<img width="800" height="1101" alt="Screenshot 2026-03-06 at 15 07 10"
src="https://github.com/user-attachments/assets/33b4366d-4d16-48db-9cc6-b79d6cc7ddc7"
/> | <img width="800" height="977" alt="Screenshot 2026-03-06 at 14 54
57"
src="https://github.com/user-attachments/assets/3d5ed38d-949d-4265-8fad-e29250c3a285"
/>

## Test coverage

<img width="800" height="916" alt="Screenshot 2026-03-06 at 15 00 42"
src="https://github.com/user-attachments/assets/5846b908-5c86-48a7-919e-a7ae198484a8"
/>



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

Release Notes:

- keymap_editor: Remove redundant parentheses when displaying keymap
context

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>

Dong and Ben Kunkle created

5aa037e Disable the `tilt` LSP by default for "Starlark" files (#51709)

Click to expand commit body
This matches how the `buck2-lsp` works for that extension.

Fixes https://github.com/zaucy/zed-starlark/issues/18

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

Release Notes:

- N/A

Alejandro Fernández Gómez created

6a06f72 extension_ci: Bump update action and fix cache issues (#51716)

Click to expand commit body
This PR bumps the update action again. It also fixes a bug where a cache
issue could occur during the extension auto bump and adds update
auto-merge for PRs from staff-members in zed-industries/extensions.

Release Notes:

- N/A

Finn Evers created

9c3aa4b agent_ui: Remove special casing for previous built in agents (#51713)

Click to expand commit body
Now that the migration has happened, we can stop making these ever
present

Release Notes:

- N/A

Ben Brandt created

5bf6e57 agent_ui: Fix non-compiling tests (#51715)

Click to expand commit body
Release Notes:

- N/A

Ben Brandt created

bfa5e88 Simplify New Worktree to only restore active buffer or fullscreen agent panel (#51700)

Click to expand commit body
Dramatically simplifies what "New Worktree" does when forking a
workspace.

Previously we captured the entire dock structure and all open file
paths, then restored them all in the new worktree workspace. Now the
behavior is:

- If you have an active buffer open, we reopen just that one file (no
other buffer state is carried over).
- If you do not have an active buffer open, we instead fullscreen (zoom)
the agent panel (equivalent to cmd-esc).

No other workspace state is carried over.

Implementation details:
- Replace `capture_dock_state` / `set_dock_structure` /
`open_item_abs_paths` with a single `active_file_path` lookup.
- Pass `None` for the `init` closure instead of restoring dock layout.
- Only reopen the single active file via `open_paths`, with proper error
logging (`detach_and_log_err`) instead of silent `.detach()`.
- Emit `PanelEvent::ZoomIn` on the agent panel when no active buffer
exists, after `focus_panel` to ensure the panel is properly activated
first.
- Warn when an active file exists but cannot be remapped to the new
worktree.

Closes AI-87

Release Notes:

- N/A

Richard Feldman created

c17bc26 Preserve selected agent when starting thread in new worktree (#51628)

Click to expand commit body
When the user selected a custom agent (e.g. Codex) and chose "Start
Thread in New Worktree", the new workspace's panel ignored the selection
and defaulted to Zed Agent (NativeAgent).

The fix captures `self.selected_agent()` in
`handle_worktree_creation_requested` before the async task, passes it
through to `setup_new_workspace`, and forwards it to `external_thread`
instead of `None`.

Closes AI-84

(No release notes because it's still feature-flagged.)

Release Notes:

- N/A

Richard Feldman created

9386e20 docs: Update Claude Sonnet 4.6 and Opus 4.6 context windows to 1M (#51695)

Click to expand commit body
## Summary

- Update the context window table in `models.md` to reflect that Claude
Sonnet 4.6 and Opus 4.6 now support 1M token context windows (previously
listed as 200k)
- Remove Sonnet 4.5/4.6 from the "may increase in future releases"
callout since the 4.6 models are now at 1M

Release Notes:

- N/A

morgankrey created

f1f61c8 agent_ui: Rename `ConnectionView` to `ConversationView` (#51684)

Click to expand commit body
We now share connections across multiple "ConnectionView"s the naming
does not make sense anymore

Release Notes:

- N/A

Bennet Bo Fenner created

44c73a8 gpui: Fix hash collision panics in ProfilingCollector (#51683)

Click to expand commit body
Release Notes:

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

Lukas Wirth created

9b5d170 editor: Go to previous and next symbol actions (#50777)

Click to expand commit body
Closes discussion #34890 

This is similar to the vim prev/next method/section motion, but more
flexible because this follows the items in editor's outline (Tree sitter
or LSP provided).

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

Release Notes:

- Added actions `editor::GoToPreviousSymbol` and
`editor::GoToNextSymbol` actions to go to the previous and next outline
symbol. This is either the tree sitter outline, or the LSP provided
outline depending on the configuration.

Karthik Nishanth created

30b7178 agent_ui: Rename `ConnectionView` to `ConversationView` (#51684)

Click to expand commit body
We now share connections across multiple "ConnectionView"s the naming
does not make sense anymore

Release Notes:

- N/A

Bennet Bo Fenner created

74eb252 editor: Fix panic in `refresh_inline_values` when spanning cross excerpts (#51685)

Click to expand commit body
Fixes ZED-5VQ

Release Notes:

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

Lukas Wirth created

74dbaeb debugger: Fall back to cached adapter binaries when offline (#50928)

Click to expand commit body
The Python (debugpy) and Go (delve-shim-dap) debug adapters
unconditionally require network access on every debug session start —
even when the adapter binary is already cached locally. This makes the
debugger completely unusable offline.

Python: fetch_debugpy_whl → maybe_fetch_new_wheel hits pypi; failure
propagates as a fatal error.
Go: install_shim → fetch_latest_adapter_version hits the GitHub API;
failure propagates as a fatal error.
CodeLLDB and JavaScript adapters already handle this correctly.

Fix for Python and Go:

Wrap the network fetch in each adapter with a fallback: if the request
fails and a previously downloaded adapter exists on disk, log a warning
and use the cached version. If no cache exists, the original error
propagates unchanged.

Logs after the fix:

```
2026-03-06T16:31:51+05:30 WARN  [dap_adapters::python] Failed to fetch latest debugpy, using cached version: getting latest release
2026-03-06T16:31:51+05:30 INFO  [dap::transport] Debug adapter has connected to TCP server 127.0.0.1:45533
```

Limitations: 

The debugger must be run at least once with internet connectivity to
populate the cache on disk. This PR does not change that requirement.


Closes #45781

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- No automated tests are included. The existing MockDelegate stubs
http_client() and fs() as unimplemented!(), so testing the fallback path
would require new mock infrastructure. The fix was verified manually by
running the debug build offline with and without cached adapters. The
CodeLLDB adapter's equivalent fallback (lines 357-374) also has no
dedicated test.
- [x] Done a self-review taking into account security and performance
aspects

Release Notes:

- Fixed debugger failing to start when offline if a debug adapter was
previously downloaded.

Nihal Kumar created

0152251 Store ACP thread metadata (#51657)

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

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>

Bennet Bo Fenner , cameron , and Ben Brandt created

6a9a7c0 Fix echo canceller not working (#51673)

Click to expand commit body
Release Notes:

- Fixed: echo's on experimental audio pipeline

Some more context:
- `EchoCanceller` was not implemented on the output side
- removes the planned migration to a different sample rate (44100) and
channel count (1)
- de-duplicate the interleaved `#cfg[]`'s and centralized them in
`echo_canceller.rs`

Yara 🏳️‍⚧️ created

8d79dd7 glsl: Bump to v0.2.2 (#51682)

Click to expand commit body
This PR bumps the version of the GLSL extension to v0.2.2.

Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>

zed-zippy[bot] and zed-zippy[bot] created

662f2c7 Update BYOK to 1m context windows (#51625)

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

Release Notes:

- Updated our BYOK integration to support the new 1M context windows for
Opus and Sonnet.

Mikayla Maki created

7b35337 glsl: Highlight null as builtin constant (#51680)

Click to expand commit body
Mostly just a test to check whether everything works properly now.

Release Notes:

- N/A

Finn Evers created

fa7182b gpui: Add `align-self` methods to `Styled` trait (#51652)

Click to expand commit body
This PR adds the missing methods for the `align-self` css property. The
`align_self` field existed on the `StyleRefinement` struct but was
inaccessible using the `styled` trait.

Release Notes:

- Adds `self_start`, `self_end`, `self_center`, `self_flex_start`,
`self_flex_end`, `self_baseline`, and `self_stretch` methods to the
`trait Styled`

Sebastian Kootz created

ae44563 git_ui: Show uncommitted change count badge on git panel icon (#49624)

Click to expand commit body
## Summary

- Implements `icon_label` on `GitPanel` to return the total count of
uncommitted changes (`new_count + changes_count`) when non-zero, capped
at `"99+"` for large repos.
- Updates `PanelButtons::render()` to render that label as a small green
badge overlaid on the panel's sidebar icon, using absolute positioning
within a `div().relative()` wrapper.
- The badge uses `version_control_added` theme color and
`LabelSize::XSmall` text with `LineHeightStyle::UiLabel` for accurate
vertical centering, positioned at the top-right corner of the icon
button.

The `icon_label` method already existed on the `Panel`/`PanelHandle`
traits with a default `None` impl, and was already implemented by
`NotificationPanel` (unread notification count) and `TerminalPanel`
(open terminal count) — but was never rendered. This wires it up for all
three panels at once.

## Notes

- Badge is positioned with non-negative offsets (`top(0)`, `right(0)`)
to stay within the parent container's bounds. The status bar's
`render_left_tools()` uses `.overflow_x_hidden()`, which in GPUI clips
both axes (the `overflow_mask` returns a full content mask whenever any
axis is non-`Visible`), so negative offsets would be clipped.
- `LineHeightStyle::UiLabel` collapses line height to `relative(1.)` so
flex centering aligns the visual glyph rather than a
taller-than-necessary line box.
- No new data tracking logic — `GitPanel` already maintains `new_count`
and `changes_count` reactively.
- No feature flag or settings added per YAGNI.

## Suggested .rules additions

The following pattern came up repeatedly and would prevent future
sessions from hitting the same issue:

```
## GPUI overflow clipping

`overflow_x_hidden()` (and any single-axis overflow setter) clips **both** axes in GPUI.
The `overflow_mask()` implementation in `style.rs` returns a full `ContentMask` (bounding box)
whenever any axis is non-`Visible`. Absolute-positioned children that extend outside the element
bounds will be clipped even if only the X axis is set to Hidden.
Avoid negative `top`/`right`/`bottom`/`left` offsets on absolute children of containers
that have any overflow hidden — keep badge/overlay elements within the parent's bounds instead.
```

Release Notes:

- Added a numeric badge to the git panel sidebar icon showing the count
of uncommitted changes.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

ISHIMWE Vainqueur and Danilo Leal created

b338a69 language_selector: Fix language selector query selection (#51581)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/51576

Release Notes:

- Select first entry in the language selector when matching a query



https://github.com/user-attachments/assets/c824c024-d2f1-416e-a347-0eab7bc3ae0a

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>

Xiaobo Liu created