Commit log

6a3111d gpui_linux: Fix X11 keyboard state synchronization (#53903)

Click to expand commit body
Closes #49329

This area has regressed a few times across #34514, #35361, and #44234.
The problem is that we were still mixing XKB client-side and server-side
state handling on the same `xkb::State`.

On X11, `XkbStateNotify` already keeps the client state synchronized.
But the key event path was still doing two extra things on the shared
`state.xkb`:
  - calling `update_key()`
  - rewriting the same state from `KeyPress` / `KeyRelease.state`

The libxkbcommon X11 docs say that `XkbStateNotify` is the more accurate
source of truth for X11 clients and that there is no need to call
`xkb_state_update_key()` once the client state is synchronized. This
follows the libxkbcommon X11 client model more closely by keeping
persistent state notify-driven and using event-local state only for
lookup.

This PR fixes that by:
- removing the remaining `update_key()` calls from X11 `KeyPress` /
`KeyRelease`
- keeping the long-lived `state.xkb` driven only by `XkbStateNotify` and
keymap notifications
  - creating a temporary event-local `xkb::State` for per-event lookup

I also added regression tests around the historical bugs in this area:
  - #14282: Caps Lock / Neo 2 regressions from the earlier X11 fixes
  - #31193: German key resolution
- #26468: `space` with Cyrillic and Czech layouts / non-locked layout
groups
  - #40678: macro-style shifted input like `Shift+]`

Release Notes:

- Fixed issue on Linux X11 where you coundn't input space key in some
cases.

Smit Barmase created

f9662f4 feedback: Add action for listing installed extensions (#48664)

Click to expand commit body
Closes #48037

- [X] Tests or screenshots needed? <--- Let me know if tests are needed
- [ ] Code Reviewed
- [X] Manual QA

Release Notes:

- Added action to copy installed extensions to clipboard

<details><summary>Picture of Action</summary><img width="1924"
height="1044" alt="Screenshot from 2026-03-03 01-00-22"
src="https://github.com/user-attachments/assets/6abe9587-968d-48e9-a3b7-80602d26375d"
/></details>
<details><summary>Picture of Modal</summary>
<img width="1920" height="1080" alt="Screenshot from 2026-03-03
01-00-35"
src="https://github.com/user-attachments/assets/b30a743d-3324-4b01-a92c-a0476908e050"
/>
</details>
<details><summary>Picture of Docs</summary>
<img width="1936" height="1066" alt="Screenshot from 2026-03-03
01-19-53"
src="https://github.com/user-attachments/assets/40dab840-c5e2-4248-b7a6-1924f0b6610c"
/>
</details>

---------

Co-authored-by: MrSubidubi <finn@zed.dev>

Matthew Chisolm and MrSubidubi created

0ddc7d0 Fix crash and enable GIF animation in markdown preview (#53459)

Click to expand commit body
Closes #53426

Fixes a crash when previewing markdown with GIFs, and enables GIF
animation in the preview panel.

Two issues: a partially-decoded GIF could crash the preview, and GIFs in
markdown previews never animated.

The fix for GIFs with empty comment extensions (`21 fe 00`) was
implemented upstream in the `image-gif` crate (image-rs/image-gif#228)
and released as `gif 0.14.2`. This PR bumps the dependency so those GIFs
now render correctly in the markdown preview without any further changes
to Zed itself.

## Screenshot
Left=VS Code
Right=Zed


https://github.com/user-attachments/assets/7950abbc-1a79-4f01-a425-9595aa688325

Release Notes:

- Fixed a crash in certain scenarios when opening Markdown Preview with
GIFs.
- Added GIF animation support for Markdown Preview.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

David Alecrim and Smit Barmase created

920ead5 docs: Exemplify a Django app debug configuration (#53545)

Click to expand commit body
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>

Pablo Soares and Finn Evers created

c2b61de themes: Make One Dark `syntax.link_text.font_style` italic (#53220)

Click to expand commit body
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 #53219 

Updates the built-in **One Dark** theme so `syntax.link_text.font_style`
is `italic`, matching other built-in themes.

Release Notes:

- Fixed One Dark `link_text` not italic

Γ†gir created

5101b3a Revert "Add ctrl-enter keybind (macOS) to type newline in search bars" (#52436)

Click to expand commit body
Reverts #50420

This was made redundant by
https://github.com/zed-industries/zed/pull/50783.

According to [this
comment](https://github.com/zed-industries/zed/pull/50783#issuecomment-4002827488),
the ctrl-enter keybind from the `Editor && mode == auto_height` context
applies to the search bars now.

Release Notes:

- N/A

Justin Su created

b6b2b63 Gate `Format Selections` on whether the active formatter can actually format ranges (#53178)

Click to expand commit body
## What Changed

- compute range-format support from formatter configuration and
language-server capabilities
- show `Format Selections` only when at least one selected buffer has a
range-capable formatter
- keep Prettier-supported range formatting available without depending
on LSP support
- hide the action for formatter modes that cannot honor selections, such
as external-command and code-action formatters
- keep the action handler safe by rechecking support and returning early
when range formatting is unavailable
- restrict capability checks to the servers actually registered for the
current buffer
- add regression coverage for supported, unsupported, and mixed-server
cases
- document when `Format Selections` is available in both action docs and
user docs


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

Release Notes:
- Improved `Format Selections` so it is only shown when the active
formatter supports range formatting.

Testing I did:

Here are the formatters I used:
<img width="829" height="434" alt="Screenshot_20260405_102047"
src="https://github.com/user-attachments/assets/cae4a238-277e-4188-873f-189e9f098699"
/>

Note: I've chosen three formatters:
1. Prettier, which supports range formatting
2. clangd (LSP) which also supports range formatting
3. gopls which do not support range formatting


[Screencast_20260405_102431.webm](https://github.com/user-attachments/assets/69ce3f95-0b73-46a0-853d-3b5be6329dde)

---------

Signed-off-by: Pratik Karki <pratik@prertik.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>

Pratik Karki and Kirill Bulatov created

a9a77f1 agent_ui: Replace stale draft thread when selected agent changes (#54023)

Click to expand commit body
## Problem

When creating a new agent thread from the sidebar's **+** button (or via
the `NewThread` / `NewThreadInGroup` actions), the panel always returned
the cached draft thread β€” even if the user had since switched to a
different agent. This meant the new thread would use the wrong agent
(typically the default Zed Agent instead of the last-used external
agent).

The root cause was in `ensure_draft()`: it cached the draft and returned
it unconditionally on subsequent calls without checking whether its
agent
matched the current `selected_agent`.

Meanwhile, **cmd-n from within the agent panel** dispatched
`NewExternalAgentThread`, which calls `create_thread()` β€” this always
creates a fresh thread with the correct `selected_agent`, so it worked
fine.

## Fix

`ensure_draft()` now compares the cached draft's agent against the
desired agent. When they differ and the draft's editor is empty, the
stale draft is discarded and a new one is created with the correct
agent.
If the draft has user-typed content, it is preserved to avoid losing
work.

## Test

Added `test_draft_replaced_when_selected_agent_changes` which verifies:
1. A draft created with `NativeAgent` gets replaced when
`selected_agent`
   changes to a custom agent
2. The replacement draft uses the correct agent
3. Calling `activate_draft` again with the same agent reuses the cached
   draft (no unnecessary replacement)

The test fails without the fix (returns the stale `NativeAgent` draft)
and passes with it.

Release Notes:

- N/A

Eric Holk created

3a897d9 Taffy nightly lint updates (#54037)

Click to expand commit body
Fixes a new lint on nightly, which crops up in gpui's taffy integration
[error logs from main's
build](https://github.com/zed-industries/zed/actions/runs/24491477164/job/71577226631).

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

Release Notes:

- N/A

Chris Biscardi created

f722e2f Respect proxy settings when fetching JSON schemas (#53954)

Click to expand commit body
This fixes #53819.

JSON schema downloads were still going through the JSON language server
without picking up Zed's configured proxy. On networks that require the
proxy, that made schema fetches fail even though the rest of the app
could connect normally.

This passes the proxy setting through to the JSON language server
configuration so schema requests follow the same network path as the
rest of Zed.

## Test plan
- `rustfmt --edition 2024 crates/languages/src/json.rs`
- `git diff --check -- crates/languages/src/json.rs`

Release Notes:

- Fixed JSON schema downloads ignoring Zed's proxy setting.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>

Hamza Paracha and Christopher Biscardi created

d066ff0 sidebar: Add some UI adjustments (#54025)

Click to expand commit body
- Don't ever swap to the ellipsis menu with the close icon button; we
now always have it
- Promote the "focus the last workspace" feature through the ellipsis
menu
- Add a unified tooltip for the thread item to show relevant thread
metadata
- Use a different icon for accessing the now "all threads" view
- Simplifies how we display archived threads
- Bonus: Don't display the "open in new window" button in currently
active worktrees (in dedicated picker)
- Bonus: Use the "main worktree" label for whenever we're mentioning the
original worktree

Release Notes:

- N/A

Danilo Leal created

74de476 Simplify parallel agents onboarding (#53854)

Click to expand commit body
- Adds a status toast to the announcement banner for surfacing the
layout revert option
- Removes the agent panel banner

A good chunk of the diff here was because I touched up the status toast
component API a little bit.

Release Notes:

- N/A

Danilo Leal created

41b6d93 Make cross-channel import tests work on any release channel branch (#54022)

Click to expand commit body
The cross-channel import tests from #54002 hardcoded
`ReleaseChannel::Preview` and `ReleaseChannel::Nightly` as source
channels. When those tests run on a release branch (where the current
channel is Preview or Nightly), the import skips the current channel,
causing test failures.

This adds a `foreign_channels` helper that dynamically picks two
channels that are neither the current one nor Dev, making the tests work
on main, preview, nightly, or any other branch.

Discovered while cherry-picking #54002 to v0.233.x (#54021).

Release Notes:

- N/A

Eric Holk created

a8decbe agent: Add ability to import threads from other channels (#54002)

Click to expand commit body
Users have been testing the threads sidebar on Nightly and Preview but
once we release the feature we expect many of these users to move back
to Stable. As it stands right now, they would lose the threads they'd
been working on. This PR adds a way to import these threads.

- [x] Add `agent: import threads from other channels` action to the
command palette.
- This can be always available for users that switch between channels
regularly.
- [x] Add tests for import behavior
- [x] Add a button that disappears after using it to make importing more
discoverable for when users first switch.

Release Notes:

- Added an action to the command palette that imports threads from other
Zed release channels into the current one.

---------

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

Eric Holk and Danilo Leal created

443c7c1 Avoid showing draft threads in the sidebar or storing them in the database (#54014)

Click to expand commit body
Release Notes:

- N/A

Max Brunsfeld created

d60b556 agent: Support remote archive thread git operations (#54001)

Click to expand commit body
### Summary

This PR implements remote support for git store operations that the
sidebar's archive thread checkpoint/restore featured relied on. This was
the second to last blocker for remote usage of this feature.

I also made a shared backend between `update_ref` and `delete_ref`
called `edit_ref` because they run the same git command and this allowed
for some code unification.

#### Remote Git Operations 
- `Repository::update_ref`
- `Repository::delete_ref`
- `Repository::repair_worktrees`
- `Repository::create_archive_checkpoint`
- `Repository::restore_archive_checkpoint`


#### Follow up

`agent_ui::thread_worktree_archive::find_or_create_repository` needs to
be made aware of the remote machine that the repository it's searching
for is on. Once that is completed, we can get the correct repo when
archiving a remote thread and the flow should work without any problems.

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

Release Notes:

- N/A

Anthony Eid created

e2780f6 Only archive worktrees that Zed created (#53991)

Click to expand commit body
When archiving a thread, we now check whether the linked worktree lives
inside the Zed-managed worktrees directory (configured via
`git.worktree_directory`). If it doesn't β€” meaning the user created it
themselves outside of Zed β€” we skip both the directory deletion and the
`git worktree remove`, leaving it untouched.

Previously, archiving a thread would delete *any* linked worktree
associated with the thread's folder paths, even ones the user had
created manually via `git worktree add`.

Release Notes:

- Fixed archiving an agent thread deleting linked git worktrees the user
created outside of Zed's managed worktrees directory.

Richard Feldman created

bf25cb1 agent: Inline worktree info fetching to remove expects in agent_panel (#54006)

Click to expand commit body
The `worktree_receivers` and `worktree_directory_setting` were pre
computed as `Option`s before the async block, then unwrapped with
`expect` inside the match arm that always had them set. Move the
fetching directly into the `WorktreeCreationArgs::New` arm so the values
are never optional, replacing the panicking expects with error
propagation via `?`.

The expects were guaranteed to never panic because the `Some` codepath
used the same branching logic of the unwrap codepath later on. This
change is just for future maintainability though.

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

Release Notes:

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

Anthony Eid created

86725ae Make flexible dock widths more closely match full-height pane splits (#53998)

Click to expand commit body
This fixes a but that @ConradIrwin noticed where the flexible docks
widths are weirdly dependent on the width of the active pane.

Release Notes:

- Fixed a bug where flexible docks resized incorrectly in certain cases.
- Fixed an issue where resizing a flexible-width panel in the left dock
would also resize fixed-width panels.

Max Brunsfeld created

a49cdce ci: Add merge queue trigger (#51833)

Click to expand commit body
This adds a merge queue trigger to our main CI job to allow for a merge
queue which runs a subset of our tests before merging to main.

With this setup, merging to main would probably take around one to two
minutes and would not catch all but definitely most issues. We could
extend it here though as we'd like.

Release Notes:

- N/A

Finn Evers created

dfe6b87 agent: Fix session not found error (#53999)

Click to expand commit body
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

Release Notes:

- N/A

Bennet Bo Fenner created

aaafc14 Add "New Center Terminal" to context menu (#53702)

Click to expand commit body
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

Release Notes:

- Added "New Center Terminal" button to window context menu

"New Terminal" only opens a new terminal window in the dedicated
terminal view, while "New Center Terminal" opens a new terminal in the
currently active view.

"+"/"New..." context menu
<img width="487" height="318" alt="Screenshot_20260411_184840"
src="https://github.com/user-attachments/assets/7c1597cf-5638-4d76-a486-537033cb8da5"
/>

Right click context menu
<img width="422" height="386" alt="Screenshot_20260411_184904"
src="https://github.com/user-attachments/assets/4e557e21-8839-4226-b704-87e37fbd8f46"
/>

Sven Vollmar created

c2736df Respect runArgs for dev containers (#53931)

Click to expand commit body
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 #53503

Release Notes:

- Fixed gap where runArgs were not respected when specified in
devcontainer.json

KyleBarton created

13185d6 Bump Zed to v0.234 (#53986)

Click to expand commit body
Release Notes:

- N/A

Joseph T. Lyons created

e79b3c6 settings: Follow up to #48003 (#53985)

Click to expand commit body
This is a follow up to #48003, instead of removing the settings key in a
new migration, we can prevent the existing one from adding settings in
the first place.

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

Release Notes:

- N/A

Bennet Bo Fenner created

3b2c12a sidebar: Remove View More batched thread expansion (#53956)

Click to expand commit body
Remove the `DEFAULT_THREADS_SHOWN` limit and the View More / Collapse
row from the sidebar thread list. When a project group is expanded, all
of its threads are now shown. Fold/unfold of project group headers is
preserved.

### Changes

- Remove `ListEntry::ViewMore` variant and `render_view_more`
- Remove `DEFAULT_THREADS_SHOWN`, `group_extra_batches`,
`set_group_visible_thread_count`, `expand/collapse_thread_group`
- Remove `visible_thread_count` from `ProjectGroupState`,
`SerializedProjectGroupState`, `ProjectGroup`, and persistence
- Remove `ShowMoreThreads` / `ShowFewerThreads` actions and vim
keybindings

cc @danilo-leal

Release Notes:

- N/A

Nathan Sobo created

3f2baed docs: Add Dexter language server to Elixir documentation (#53793)

Click to expand commit body
### Docs update.

  - adding 'what is Dexter' one-liner
  - adding config examples

Self-Review Checklist:

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

βœ… Elixir LS update -
[PR](https://github.com/zed-extensions/elixir/pull/115) merged

Release Notes:
- N/A

---------

Co-authored-by: AltCode <altcode@vivaldi.net>

Nick C and AltCode created

47059dc settings: Remove `settings` field from HTTP `context_servers` (#48003)

Click to expand commit body
HTTP context servers don’t support the settings field, so remove it
during migration to avoid confusion. Other context server types are
unaffected.

Closes #44786.


https://github.com/user-attachments/assets/4cabf405-c9e7-4d6e-a43d-f642fc4771e0



Release Notes:

- Removed deprecated key from HTTP `context_servers`

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>

Kunall Banerjee , Bennet Bo Fenner , and Bennet Bo Fenner created

bfc34a6 sidebar: Refine archive view (#53975)

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

Closes #ISSUE

Release Notes:

- N/A

---------

Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Bennet Bo Fenner , Gaauwe Rombouts , and Danilo Leal created

e69b112 agent: Add telemetry for parallel agents (#52919)

Click to expand commit body
Track new telemetry:


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

Release Notes: 

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>

Katie Geer and Bennet Bo Fenner created

ab93615 sidebar: Fix removed projects not immediately disappearing from the UI (#53974)

Click to expand commit body
Release Notes:

- N/A

Danilo Leal created

2ea5644 Simplify draft threads (#53940)

Click to expand commit body
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

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Mikayla Maki and Max Brunsfeld created

e676365 agent_ui: Fix focus moving to buffer on worktree creation (#53972)

Click to expand commit body
Follow-up to https://github.com/zed-industries/zed/pull/53941

Release Notes:

- N/A

Danilo Leal created

f81a5ec workspace: Native open dialog multi-select (#53963)

Cameron Mcloughlin created

963329c sidebar: Propagate workspace trust when creating new worktrees (#53833)

Click to expand commit body
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>

Cameron Mcloughlin and Zed Zippy created

ac02b1b remote: Set current_dir for cargo zigbuild cross-compilation (#53951)

Click to expand commit body
## Summary

- The cross-compile path for building `remote_server` via `cargo
zigbuild` was missing `.current_dir()`, causing it to inherit the
process cwd
- This fails with "cannot specify features for packages outside of
workspace" when Zed is launched from outside its source tree
- The native build path at the same location already sets
`.current_dir()` correctly β€” this aligns the cross-compile path

Closes #53950

## Test plan

- [x] Build Zed from source
- [x] Launch from `/tmp`: `cd /tmp && /path/to/zed some-project
--dev-container`
- [x] Verify dev container cross-compilation succeeds

Release Notes:

- Fixed dev container cross-compilation failing when Zed is launched
from outside its source directory

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

Toni Alatalo and Claude Opus 4.6 created

b928e59 Select and scroll to the best search match in settings (#53916)

Click to expand commit body
When adding code lens to the long list of search items, I've failed to
find it when searching, as we always select first item in the matches
list, which is not necessarily the best one.

Left is before, right is after:


https://github.com/user-attachments/assets/9033dfd8-abde-4a45-a214-ae859105d6ad


Release Notes:

- Improved settings search ergonomics

Kirill Bulatov created

44305e6 compliance: Remove irrelevant case (#53936)

Click to expand commit body
We will not be proceeding with this, thus removing it here to have less
variants.

Release Notes:

- N/A

Finn Evers created

dec1a2a gemini: Fix tool schema issues when type field is array (#53834)

Click to expand commit body
Closes #53919

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

Release Notes:

- gemini: Fixed an issue with MCP servers specifying tools with specific
schemas

Bennet Bo Fenner created

bc84d80 settings_ui: Gate CLI open behavior setting on feature flag (#53964)

Click to expand commit body
The `cli_default_open_behavior` setting controls how `zed <path>` opens
directories, but the underlying behavior is gated behind the
`AgentV2FeatureFlag` in `open_listener.rs`. Without the flag enabled,
the setting has no effect β€” Zed always falls back to `NewWindow`
behavior.

This change gates the settings UI entry behind the same feature flag so
it only appears when the feature is actually active.

**Changes:**
- Converted `general_settings_section()` from a fixed-size array to a
`Vec` so the CLI setting can be conditionally appended
- Added `feature_flags` as a dependency to `settings_ui`

Release Notes:

- N/A

Eric Holk created

1cd3249 editor: Fix stale session path for renamed files (#52539)

Click to expand commit body
## Context

When a file is renamed via the project panel while open in an editor,
Zed would restore the old (no longer existing) path on reload .

On rename, `language::Buffer` emits `BufferEvent::FileHandleChanged`,
which propagates to `multi_buffer::Event::FileHandleChanged` β†’
`EditorEvent::TitleChanged`. However, `should_serialize()` only matched
`Saved | DirtyChanged | BufferEdited`, so no re-serialization was
triggered and the `editors` DB table retained the stale `abs_path`.

The fix adds a dedicated `EditorEvent::FileHandleChanged` variant, emits
it alongside `TitleChanged` when the buffer's file handle changes, and
adds it to `should_serialize()`. Since `Editor::serialize()` already
reads the current path from the buffer at call time, this naturally
writes the new path to the DB.

Closes #51629

## How to Review

Three files edited:
- `editor.rs`: splits `FileHandleChanged` into its own arm and emits the
new event variant
- `items.rs`: adds `FileHandleChanged` to `should_serialize`
- `items.rs` (test): `test_file_handle_changed_on_rename` does a full
rename via `Project::rename_entry` and asserts the event fires and the
buffer path updates

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

Release Notes:

- Fixed renamed files being reopened with their old path after a restart

**Important remark :**
This pull request is a follow-up on the review of @SomeoneToIgnore on
this pull request, https://github.com/zed-industries/zed/pull/51717,
which was inadvertently closed because I mistakenly deleted my previous
fork of the zed repo, sorry for any inconvenience caused by this

Manual test video below :

[Screencast from 2026-03-16
23-28-46.webm](https://github.com/user-attachments/assets/ff2e3259-ae26-4655-83b8-f693e84306d2)

saberoueslati created

e613b2c tab_switcher: Keep tab switcher open when closing last tab in active pane (#53279)

Click to expand commit body
## Context

Closes #53252

When using `ToggleAll` to open the tab switcher and then closing the
last tab in the currently active pane via `CloseSelectedItem`, the tab
switcher would unexpectedly dismiss. Closing tabs from an inactive pane
worked correctly.

**Root cause:** `force_remove_pane` in `Workspace` unconditionally calls
`window.focus(fallback_pane)` when the active pane is removed. This
focus change causes the tab switcher picker's editor to receive a
`Blurred` event, which
triggers `Picker::cancel` β†’ `delegate.dismissed` β†’ `DismissEvent`,
dismissing the modal.

**Fix:** When a modal is active, skip the `window.focus` call and
instead call `set_active_pane` directly. This keeps the active pane
pointer up to date without stealing focus from the modal.

Video of manual test after fix :

[Screencast from 2026-04-07
00-24-56.webm](https://github.com/user-attachments/assets/eeb74313-1713-48db-8421-db740ef7a7b2)

## How to Review

- `crates/workspace/src/workspace.rs` : In `force_remove_pane`, when the
removed pane was the active pane, the fallback pane now only receives
focus if no modal is currently open. Otherwise, `set_active_pane` is
called directly, which updates `active_pane`, `last_active_center_pane`,
and the status bar without touching window focus.

- `crates/tab_switcher/src/tab_switcher_tests.rs` : New test
`test_toggle_all_stays_open_after_closing_last_tab_in_active_pane`
reproduces the issue: two panes each with one file, the active pane's
tab is closed via `CloseSelectedItem`, and the test asserts the tab
switcher remains open with the other file still listed.

## 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 tab switcher dismissing when closing the last tab in the active
pane

saberoueslati created

d3d8f15 ep: Send edit prediction mode in prediction request (#53812)

Click to expand commit body
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 #ISSUE

Release Notes:

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

Ben Kunkle created

1a6c2ae Prefer Ollama configured model context length over model architecture context length (#53543)

Click to expand commit body
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

Fixes calculation of Ollama model context length. Now prefers num_ctx
model configuration over model architecture context length the same way
Ollama does.

Closes #42340

Release Notes:

- Fix calculation of Ollama model context length

MarekMalevic created

a30bc61 Delete worktree directory before git metadata cleanup during archive (#53959)

Click to expand commit body
When archiving a thread's linked worktree, `git worktree remove` can
fail to delete the working directory while still removing the admin
metadata in `.git/worktrees/<name>`. This leaves an orphaned folder on
disk that no longer appears in `git worktree list`.

## Fix

Delete the directory ourselves first with `std::fs::remove_dir_all`,
then call `git worktree remove --force` to clean up only the admin
entry. Git already handles the case where the working tree is already
gone (since
[git/git@ee6763a](https://github.com/git/git/commit/ee6763af0a3b97225803c6c908a29de40336cf38)).

Also fixes `FakeGitRepository::remove_worktree` to handle a missing
working tree directory (matching real git behavior) by scanning
`.git/worktrees/` entries when the `.git` pointer file can't be read.

Release Notes:

- Fixed archiving an agent thread sometimes leaving the worktree folder
on disk even though the git worktree was removed.

Richard Feldman created

848c3da docs: Fix stale MCP extension links (#53946)

Click to expand commit body
This fixes #53740.

A few MCP docs links were still pointing at old extension slugs, so they
led to dead pages. This updates those links to the current canonical
slugs.

Release Notes:

- N/A

Hamza Paracha created

ad5d015 cli: Fix -n behavior and refactor open options (#53939)

Click to expand commit body
This fixes a regression where `zed -n .` in a subdirectory of an
already-open
project would redirect to the parent window instead of creating a new
one.
The root cause was that commit 66d2cb20c9 ("Adjust `zed -n` behavior")
made
`-n` run the worktree matching loop with subdirectory matching enabled,
when
previously `-n` skipped matching entirely.

## Changes

### Bug fix
- **Restore `-n` to always create a new window.** No worktree matching,
no
exceptions. This matches the behavior from when `-n` was first
introduced.

### New `--classic` flag
- Adds a hidden `--classic` CLI flag that explicitly selects the
pre-sidebar
default behavior: new window for directories, reuse existing window for
  files already in an open worktree.
- The `cli_default_open_behavior` setting now toggles between `-e` (add
to
sidebar) and `--classic` behavior. When set to `new_window`, the classic
  logic is used instead of unconditionally opening a new window.

### Refactor CLI open options
Replaces the old grab-bag of `open_new_workspace: Option<bool>`,
`force_existing_window: bool`, `classic: bool`, and `reuse: bool` with:

- **`cli::CliOpenBehavior` enum** β€” a single enum on the IPC boundary
with
variants `Default`, `AlwaysNew`, `Add`, `ExistingWindow`, `Classic`, and
  `Reuse`.
- **`workspace::WorkspaceMatching` enum** β€” describes how to match paths
against existing worktrees (`None`, `MatchExact`, `MatchSubdirectory`).
- **`workspace::OpenOptions`** β€” uses `WorkspaceMatching` plus a simple
  `add_dirs_to_sidebar: bool` instead of overlapping boolean flags.

The translation from CLI enum to workspace options happens in
`open_listener.rs`, keeping both layers clean and independent.

Release Notes:

- N/A

Eric Holk created

dc5e2f1 sidebar: Show branch name after worktree name (#53900)

Click to expand commit body
<img width="297" height="505" alt="Screenshot 2026-04-14 at 3 20 23β€―PM"
src="https://github.com/user-attachments/assets/90366ccd-86db-497e-9c81-af94b4144ebe"
/>


Display the git branch name alongside the worktree name in the sidebar's
thread list (or without the worktree name, if it's a main worktree).

Release Notes:

- Added branch name display next to worktree names in the agent sidebar
thread list.

Richard Feldman created

6beecae agent_ui: Improve the new thread worktree UX (#53941)

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

- Remove the ability to pick a branch from the agent panel; delegate
this to the title bar picker
- Make the worktree creation earger, just as you selected whether you
want to create it from main or current branch
- Remove flicker when creating a new worktree and switching to a
previously existing one
- Improve some UI stuff: how we display that a worktree is
creating/loading, the branch and worktree icons, etc.
- Fixed a bug where worktrees in a detached HEAD state wouldn't show up
in the worktree pickers

A big part of the diff of this PR is the removal of everything involved
with the `StartThreadIn` enum/the set up involved in only creating the
worktree by the time of the first prompt send.

Release Notes:

- Agent: Improved and simplified the UX of creating threads in Git
worktrees.
- Git: Fixed a bug where worktrees in a detached HEAD state wouldn't
show up in the worktree picker.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>

Danilo Leal and Nathan Sobo created

6467d4f Improve error handling in worktree restore and archive paths (#53927)

Click to expand commit body
Improves the worktree restore and archive code paths:

- In `restore_worktree_via_git`, the old code blindly attempted
`change_branch` and fell back to `create_branch` on failure, which could
clobber a branch that had moved to a different SHA during archival. Now
resolves the branch ref first and only checks out the branch if it still
points at the original commit; if the branch has moved, the worktree
stays in detached HEAD. If the branch doesn't exist, tries to recreate
it.
- In `change_worktree_paths` and `change_worktree_paths_by_main`,
archived threads are now excluded from path mutations so their folder
paths are preserved for restore.
- In the sidebar, `ProjectGroupKey` construction for archived thread
activation now uses `from_worktree_paths` (which resolves to main
worktree paths) instead of `new` with the linked worktree's folder
paths. This ensures that restoring a linked worktree thread matches the
main repo workspace rather than creating a spurious new one.
- Added `Repository::resolve_ref` for resolving a git ref to its SHA.
- Added tests for `resolve_ref`, branch-moved/not-moved/deleted restore
scenarios, and workspace-matching on restore.

Release Notes:

- N/A

Richard Feldman created