Commit graph

39654 commits

Author SHA1 Message Date
MrSubidubi
b76c6d9fc8 Don't sleep on the job 2026-08-22 15:00:19 +02:00
MrSubidubi
a49a6868d7 ci: Add cargo-sort 2026-08-22 00:51:45 +02:00
Marshall Bowers
fd82517a11
git_hosting_providers: Add Tangled support (#63051)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
This PR adds support for [Tangled](https://tangled.org/) as a Git
hosting provider.

Release Notes:

- Added support for permalinks to [Tangled](https://tangled.org/)
repositories.
2026-08-21 21:31:55 +00:00
Anthony Eid
7316cf7745
gpui: Report foreground executor work in bench reports (#63035)
`BenchReport`'s frame histograms only ever recorded a window's draw and
present timings, so a slow foreground task that never dirtied or drew a
window was invisible to `gpui::bench` consumers even though GPUI's
foreground journal already timed it. Delta hit this concretely: a
foreground task stalled for 76-130ms with no window draw in progress,
and the only way to see it in a benchmark was to manually queue a marker
task and time it by hand, outside the normal report.

GPUI already has the data needed to close this gap. The foreground
journal (`crate::profiler::journal`, merged separately in #62779) times
every foreground task poll, action handler, and input dispatch on the
main thread, independent of whether a window ever gets involved. This PR
wires that journal into `BenchAppContext`/`BenchReport` so the existing
benchmark harness reports it directly, instead of asking benchmark
authors to build their own timing side channel.

`TraceScope`, the type that already scopes frame-timing collection to a
measurement, now also owns a `ForegroundJournalCollector` created at the
same point it starts. Since a collector only observes journal entries
recorded after its own creation, per-iteration setup work (which runs
before the trace scope starts) is excluded from the measurement by
construction, the same way it already was for draw/present timings.
Drained task poll, action, and input events are recorded into a new
`foreground_work` duration histogram on `BenchReport` (draws and
presents are skipped there since the existing frame-timing histograms
already cover them), exposed through `BenchReport::foreground_work()` as
`count`/`total`/`max`/percentiles plus frame-budget overruns at the
report's configured FPS, and printed alongside the existing histograms.

Because this rides on the same per-task-poll instrumentation that
already powers GPUI's hang detection, it works for `bench_task`,
`bench_batched_task`, and `bench_renderer` without requiring a window at
all, and it aggregates every foreground event recorded during a
measurement (not just the first).

The `#[cfg(test)]`-only `install_test_foreground_journal` helper is
widened from `pub(super)` to `pub(crate)` so `bench_context`'s own tests
can install an isolated per-thread journal instead of sharing (and being
interfered by) whatever the shared production journal on that thread
happens to hold.

## Testing

- `cargo test -p gpui --features bench --lib bench_context` - two new
focused unit tests drive the foreground journal directly: one proves a
60ms synchronous task poll with no window is reported as foreground work
with no frame events recorded; the other proves an 80ms task poll before
the trace scope starts is excluded from the measured summary. A third
test exercises the real public API end to end, running
`BenchAppContext::bench_task` through an actual `criterion::Bencher`
(via `criterion::Criterion::bench_function`) and asserting the ~20ms
task shows up in `BenchReport::foreground_work()`.
- `cargo nextest run -p gpui --features bench --lib profiler` - the
existing foreground journal, hang detection, and frame-timing test
suites still pass unchanged.
- `cargo check -p benchmarks --benches` - the existing `#[gpui::bench]`
consumers (`bench_iter`, `bench_renderer`) still compile against the
updated `TraceScope`/`BenchReport` internals.
- `cargo fmt --package gpui -- --check` and `./script/clippy -p gpui
--features bench` are clean.

Release Notes:

- N/A
2026-08-21 19:46:11 +00:00
Chris Biscardi
f36aec822b
Disable ask_user by default (#63036)
## Objective 

There are [some formatting
issues](https://github.com/zed-industries/zed/issues/62955) with the
`ask_user` tool, but more importantly they seem to be confusing when
sub-agents are used, which are not always visible immediately. (Some
team members flat out also don't like being given options, which is the
purpose of the tool).

## Solution

disable the `ask_user` tool by default, allowing users who want it to
enable it in settings by setting `"ask_user": true,` as such:

```json
"agent": {
    "profiles": {
      "write": {
        "name": "Write",
        "enable_all_context_servers": true,
        "tools": {
          "copy_path": true,
          "create_directory": true,
          "create_thread": true,
          "delete_path": true,
          "diagnostics": true,
          "apply_code_action": true,
          "ask_user": true,
          "edit_file": true,
          "write_file": true,
          "fetch": true,
          "find_path": true,
          "find_references": true,
          "get_code_actions": true,
          "go_to_definition": true,
          "list_agents_and_models": true,
          "list_directory": true,
          "move_path": true,
          "rename_symbol": true,
          "read_file": true,
          "grep": true,
          "skill": true,
          "spawn_agent": true,
          "terminal": true,
          "search_web": true,
        },
      },
    },
},
```

## Testing

Ask an agent to ask you a question. By default, options should not be
shown, with the above configuration options should be shown.

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

## Showcase

Without tool:

<img width="1138" height="556" alt="CleanShot 2026-08-21 at 10 21 35@2x"
src="https://github.com/user-attachments/assets/6fd2cdbb-af84-49e9-acc5-db5a4359acbe"
/>

With tool:

<img width="1160" height="974" alt="CleanShot 2026-08-21 at 10 22 57@2x"
src="https://github.com/user-attachments/assets/7a4488e4-96f0-40d4-a4c4-70f489b70f12"
/>


---

Release Notes:

- Disable ask_user tool by default
2026-08-21 17:42:46 +00:00
Kirill Bulatov
107ee1a60a
Register terminal panel before restoring serialized terminals (#62712)
Closes https://github.com/zed-industries/zed/issues/62435
Part of https://github.com/zed-industries/zed/issues/60548

Before:


https://github.com/user-attachments/assets/6b5147da-44cb-40c7-9da5-c50145e2ab4e

After:


https://github.com/user-attachments/assets/c58423cc-ea99-40d9-ad18-23b31dfb8e5d


Previously, `TerminalPanel::load` awaited full deserialization of
serialized
terminals (each awaiting directory environment capture via a login
shell)
before the panel was registered in the dock. 

Until then, `terminal_panel::Toggle{Focus}` was a silent no-op: the
workspace finds no
panel in any dock, the keystroke is eaten, and nothing happens.

When it got eventually restored, it would close whatever panel in the
dock was open manually instead, wrecking the workflow.

Repro:
1. Add `case "$ZSH_EXECUTION_STRING" in *--printenv*) sleep 10;; esac`
to `~/.zshrc`.
2. Open a project, open at least one terminal in the panel, quit Zed
(Cmd+Q).
3. Relaunch via Dock/Spotlight (not the `zed` CLI, which skips env
capture via
   `cli_environment`).
4. Press the terminal shortcut within 10s: nothing happens; after ~10s
the
   panel appears and the shortcut works.

* `Register terminal panel before restoring serialized terminals` — the
panel
  is now created and registered immediately, and restoration runs in
  panel-owned tasks (cancelled on panel drop, nothing detached).
  Terminal-adding paths were initially queued behind restoration (later
  replaced by grafting, see below); the default shell spawns only if the
  panel ends up active and empty after restore.

* `Stop replaying serialized dock state over manual panel changes` —
fixes a
related race: `Dock::add_panel` replayed the serialized dock state
(active
panel, visibility, zoom) on every panel insertion, so a late-loading
panel
would re-activate the serialized panel over one the user had switched to
in
the meantime (e.g. the terminal panel yanking the dock away from the
agent
  panel), or re-open a dock the user had closed. Serialized state is now
applied at most once and is discarded as soon as the user changes the
dock
state manually. The new tests fail without this change and pass with it.

* `Show restoration progress in the terminal panel and allow spawning
terminals during it` — while terminals restore, the panel shows a
spinner
with "Restoring terminals…" instead of a blank pane, and logs the
restored
count and elapsed time. Supersedes the queuing from the first commit:
new
terminals spawn immediately, and any that land mid-restore are grafted
into
the restored layout instead of being lost. Serialization is paused
during
restoration, so quitting mid-restore can no longer persist a partial tab
  list and silently drop terminals.


Release Notes:

- Fixed the terminal panel not opening at all under certain
circumstances, made panels no longer switching back to the serialized
one when opened during startup.
2026-08-21 17:26:29 +00:00
Ben Kunkle
1ea16c1ab9
git_ui: Add action to toggle diff base (#62966)
# Objective

- Make it easy to switch Git features between showing uncommitted
changes and all changes on the current branch.

## Solution

- Add `git::ToggleDiffBase`, which toggles the user setting between
`head` and `default_branch`.

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

- Git: Added an action to toggle the diff base between HEAD and the
default branch.
2026-08-21 16:02:27 +00:00
Kirill Bulatov
a7e23df67b
markdown: Restore fallback language highlighting for untagged code blocks (#63023)
Restores fallback highlights lost in
https://github.com/zed-industries/zed/pull/28217

Release Notes:

- N/A
2026-08-21 16:00:50 +00:00
Finn Evers
51a3ac29de
extension_cli: Add basic validation for extension manifest (#59189)
This PR adds some validation for the extension manifest. 
Mostly,

- it tests that name and description are set and non-empty
- the authors-list is non-empty
- the repository URL is actually a parseable URL and reachable with a
200 code

Release Notes:

- N/A
2026-08-21 15:34:46 +00:00
Conrad Irwin
53dbfe4073
language_model: Include hosts in transport errors (#62990)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
Language model transport errors currently retain only a provider display
name after an HTTP request fails. Downstream clients therefore cannot
tell users which configured endpoint was unreachable without parsing the
source error or hard-coding provider names.

Make the request hostname a required part of
`LanguageModelCompletionError::HttpSend` and preserve it through the
Anthropic, OpenAI-compatible, OpenRouter, Vercel AI Gateway, and Zed
Cloud transports. Each transport captures the parsed hostname from the
request URI before sending it, using the configured base URL as the
defensive fallback. This supports production, development, and custom
endpoints without string matching.

Tests exercise transport failures through the real request paths and
verify hostnames for Anthropic, ChatGPT Subscription, generic
OpenAI-compatible providers, and Zed Cloud.

Testing:

- `cargo fmt --check`
- `cargo nextest run -p anthropic -p open_ai -p open_router -p
language_models_cloud -p language_models` — 209 tests passed
- `cargo check -p agent -p agent_ui --all-targets`
- `git diff --check`
- `./script/clippy -p language_model_core -p anthropic -p open_ai -p
open_router -p language_models_cloud -p language_models` — clippy
passed; the script subsequently failed in the repository-wide `cargo
shear --deny-warnings` step on 203 pre-existing target and doctest
configuration warnings

Release Notes:

- Improved language model connection errors to identify the unreachable
host.
2026-08-21 14:53:09 +00:00
Dino
4c763e1563
git_ui: Prevent context menu binding flicker (#63021)
# Objective

Ensure that the bindings displayed in the Git Panel's context menu do
not change between the first and subsequent frames.

## Solution

Git panel context menus could briefly display bindings from the generic
`GitPanel` context before switching to the more specific `ChangesList`
bindings. This was especially noticeable with Vim mode enabled, where
"Stage All" changed from `ctrl-cmd-y` to `shift-x`.

Since `GitPanel::dispatch_context` relies on
`FocusHandle::contains_focused` to be `true` in order to add the `menu`
and `ChangesList` contexts it could fail on the first frame the context
menu is shown, as the menu's focus handle is absent from the previous
frame's dispatch tree when first focused.

The simplest fix in this case is to fallback to
`GitPanel::context_menu::is_some()` in case
`GitPanel::focus_handle::contains_focused` returns `false`.

## Testing

Tested both manually as well as updated an existing test to ensure that,
when the context menu is first focused, both the `menu` and
`ChangesList` context are still present, even if no frame is rendered.

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

## Showcase

<details>
  <summary>Before</summary>

Notice how the "Stage All" binding changes from `ctrl-cmd-y` (macOS) to
`shift-x` (vim).


https://github.com/user-attachments/assets/1d2e2de5-dce4-422c-8d63-4bcd93375431
</details>

<details>
  <summary>After</summary>


https://github.com/user-attachments/assets/79e74c3f-8358-4e7c-8eb9-74fa36adde67
</details>

## Future Work

It's still possible for the bug to show up the first time the very first
time the context menu is actually opened, if the Git Panel was not
previously focused, that is, using `right-click` on the Git Panel while
the editor was focused, for example. I suspect this has to do with how
`Window::highest_precedence_binding_for_action_in` also relies on the
previous frame's dispatch tree, at which point the `GitPanel` was not
yet available in the context.

---

Release Notes:

- Fixed issue where the bindings shown in the Git Panel's context menu
would change after the first frame.
2026-08-21 14:37:51 +00:00
Matei Oprea
907ed09c9f
editor: Prevent auto save formatting on read only files (#62921)
# Objective

Read-only marked files in zed could still be affected by format on save
feature. This PR fixes that.
FIXES #62899 

## Solution

These changes add an early return on Editor's `Item::save`
implementation so neither formatting nor the write to disk occurs.

## Testing

I've tested by reproducing the issue in the original ticket. 

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

- Fixed read-only files being formatted and saved when `format_on_save`
is enabled

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-08-21 13:19:58 +00:00
Bennet Bo Fenner
ec18126b1d
mermaid_render: Update merman to 0.8.0-alpha.5 (#62931)
Release Notes:

- Fixed an issue where labels in mermaid diagrams would not soft-wrap
correctly
2026-08-21 11:29:58 +00:00
Smit Barmase
10b2925e7c
docs: Document language auto-indentation rules (#63009)
This PR updates the language extension docs for syntax-based rules,
line-based rules, and context-aware alignment. It is a follow-up to
#33370.

Release Notes:
- N/A
2026-08-21 10:43:42 +00:00
Finn Evers
075520b968
git_graph: Focus search editor on open (#63002)
Release Notes:

- The git graph and git history view will now focus the search editor on
initial focus
2026-08-21 10:36:13 +00:00
Kirill Bulatov
9b5b58607b
Update .rules to prompt for self-review before submitting PR (#62945)
Release Notes:

- N/A
2026-08-21 10:32:14 +00:00
Finn Evers
875e2a1c45
Revise extension publishing documentation (#62767)
Release Notes:

- N/A
2026-08-21 10:06:24 +00:00
Smit Barmase
ab208db8d2
language: Fix flaky bracket range deduplication test (#62996)
Noticed this in [this CI
run](https://github.com/zed-industries/zed/actions/runs/32452508104/job/96683569873?pr=62989).
The test now waits for parsing before taking its snapshot.

Release Notes:
- N/A
2026-08-21 10:04:18 +00:00
Smit Barmase
54230ad8fd
settings_content: Add OpenAI subscription provider autocomplete (#62989)
Release Notes:

- Added settings autocomplete for the OpenAI subscription language model
provider.
2026-08-21 09:48:51 +00:00
Neel
eb354c8d50
gpui: Make the Wayland render loop demand-driven (#60690)
Closes #55345.

Wayland is the only platform whose frame ticks are conditional: a
wl_surface frame callback only arrives after a commit the compositor
goes on to repaint.

GPUI assumed unconditional ticks (any previously our Wayland backend
faked them), so an idle fullscreen window
stopped receiving callbacks and froze until external damage arrived.

This PR makes the Wayland render loop demand-driven, instead parking
when there's nothing to draw, and stops Zed committing empty frames on
every tick as the artificial heartbeat from the compositor.

---

Release Notes:

- Fixed the UI freezing in fullscreen on some Wayland compositors
- Fixed idle windows waking at the display's refresh rate on Wayland

---------

Co-authored-by: Philipp Schaffrath <philipp.schaffrath@gmail.com>
Co-authored-by: Daan De Meyer <daan@amutable.com>
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-08-21 09:43:16 +00:00
Lena
ef50ad95b5
Automate cleanup of unsigned and stale draft pull requests (#62936)
- Notify the author when their PR has been in draft state with no new
commits for three weeks
- Close the draft PRs that didn't get updated after one more week
- Re-try the cla-bot check on PRs that are still unsigned after a week
- Close the PRs that are still unsigned after the re-try

## Testing

It works on my machine™

```
python script/github-pr-cleanup.py --dry-run
Checking 713 open pull requests
Dry-run mode: no comments or closures will be made
PR #60885: asking the CLA bot to check again
  Would comment on PR #60885:
@cla-bot check

PR #61625: asking the CLA bot to check again
  Would comment on PR #61625:
@cla-bot check

PR #57239: warning about a stale draft
  Would comment on PR #57239:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #57241: warning about a stale draft
  Would comment on PR #57241:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61461: warning about a stale draft
  Would comment on PR #61461:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61722: warning about a stale draft
  Would comment on PR #61722:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61808: warning about a stale draft
  Would comment on PR #61808:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61809: warning about a stale draft
  Would comment on PR #61809:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

Cleanup complete: 0 unsigned PR closures, 6 draft warnings, 0 draft closures
```



Release Notes:

- N/A
2026-08-21 07:53:28 +00:00
tidely
5b70f793d3
Use Duration to improve type safety and unit correctness (#62969)
# Objective

- Prefer using `Duration` instead of integers when dealing with spans of
time. This prevents confusing different units of time and comparing
arbitrary integers with durations.
- Remove `_ms`/`_secs` suffixes from variables which are `Duration`,
since their unit is inside of the type.
- Initialize large integer constants using `Duration`, which has more
descriptive constructors, while maintaining the resulting integer type.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-08-21 07:28:05 +00:00
Lena
84aaa52595
Remove unused triage project sync workflow (#62992)
We're not using it at the moment, so, removing it to avoid confusion
with the other triage-related automations.

Release Notes:

- N/A
2026-08-21 07:06:56 +00:00
Conrad Irwin
5255bd7f27
anthropic: Handle additional API error codes (#62984)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
Anthropic now returns distinct error types for billing failures, request
conflicts, and gateway timeouts. Because the Anthropic client did not
recognize these values, they fell through to
`LanguageModelCompletionError::Other`, losing their structured status
and causing callers to apply generic handling.

Recognize the documented `billing_error`, `conflict_error`, and
`timeout_error` codes. Billing failures now become `PaymentRequired`,
conflicts preserve their HTTP 409 status and provider message, and
timeouts become typed upstream HTTP 504 failures. End-to-end tests
exercise each mapping through the HTTP response parsing path.

Testing:

- `cargo fmt --check`
- `cargo nextest run -p anthropic`
- `./script/clippy -p anthropic`
- `git diff --check`

Release Notes:

- Fixed handling of Anthropic billing, conflict, and timeout errors.
2026-08-21 05:38:56 +00:00
Chris Biscardi
91bf967e27
Implement inspector flag (#62920)
Some checks are pending
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / tests_pass (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
Congratsbot / check-author (push) Waiting to run
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
# Objective

Make it easy to conditionally enable the gpui inspector, with a goal of
eventually turning it on in nightly.

## Solution

The new `zed/inspector` flag (and supporting flags in other crates)
enables the relevant inspector features in `gpui`, `ui`, and
`inspector_ui` to be able to display the gpui inspector.

## Testing

- Enabling the inspector adds about 5mb to the binary, and for context
the zed binary is > 400mb at this time.
- Observationally, the inspector doesn't affect performance in a
meaningful way, but I did not run profiling.

```
# release with inspector (inspector on)
cargo run --release --features inspector
# release without inspector (inspector off)
cargo run --release
# dev build with debug assertions (inspector on)
cargo run
```

then trigger `dev::ToggleInspector`.

- linux: `ctrl-alt-i`
- windows: `shift-alt-i`
- macos: `cmd-alt-i`

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

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-08-20 22:09:43 +00:00
Andrew Goode
f5e87e5343
settings_ui: Add Clear button to the search field (#56033)
This PR adds a 'clear' button to the search field in the Settings
window. The button becomes visible only when the field contains text.
Clicking the button clears the search field, which also resets the
navigation list.

Empty:
<img width="213" height="41" alt="image"
src="https://github.com/user-attachments/assets/03f97367-1036-453f-816a-5cbad219951c"
/>

With a search term:
<img width="213" height="38" alt="image"
src="https://github.com/user-attachments/assets/518047f4-c397-4a34-bb2f-147fcf37dc69"
/>


There are similar UIs, like the macOS and Windows System Settings
windows, and even Zed's 'Help' menu filter (on macOS), where the field
acts as a 'live filter', updating results on each keystroke, and the
'clear' action is more convenient than backspacing.

The first commit adds the button and the 'on click' functionality. If
the Zed team approves this change, I would also like to use the `escape`
key to clear the field. I have done some work on this, but there are
several issues and I would like some feedback before committing the
appropriate changes:
1. The `escape` binding to clear the field could arguably be built-in
(not user-configurable) since it's the standard key for this type of
action, and it may not make sense to allow other key combinations since
this field accepts keyboard input. Would the team approve a built-in key
binding, or must it be bound to a user-configurable `Action`?
2. For the Settings Window, `escape` is currently bound to the
`CloseWindow` Action by default. If the search field is focused,
pressing the `escape` key should clear the field, but not close the
window.
- If a new `Action` is used to clear the field (containing text), the
binding to that `Action` can have a more specific context
(`SettingsWindow > NavigationMenu && search`) than the `Action` on the
window (`SettingsWindow > NavigationMenu`), so the window won't close …
but if the field is *already empty*, should `escape` close the window
(and is there a way to re-enable the `CloseWindow` action in that case)?
- If a `KeyDownEvent` listener for `escape` is used to clear the field,
the `CloseWindow` Action still closes the window – is there a way to
cancel the `CloseWindow` Action in this case?
3. There is at least one other location with a similar 'live filter'
field, namely the Filter field in the Keymap Editor, where this same
functionality could be implemented. (I could update that too if this PR
is approved). Are there other similar instances in Zed? This 'clear
filter' UX should be consistent in all those locations.

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

(I could not find an existing issue or discussion about this feature.)

Release Notes:

- Added a 'clear' button to the search field in the Settings window,
which clears the field and resets the navigation list.

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-08-20 21:30:49 +00:00
Cameron Mcloughlin
fe9556a11e
gpui: Map ztracing events to browser performance APIs on web (#62898)
Makes `ztracing` spans work on the web, by mapping them to browser
`performance` APIs.

Since calling into JS from wasm has fairly high overhead, we instead
have a dedicated reporter task that threads send timing information to.

This approach significantly decreases the performance overhead of the
span-capturing thread (which is usually the performance sensitive one),
at the expense of:
- erasing thread information for spans in the browser devtools
- potentially dropping events if the bounded queue becomes full

The first issue can be mitigated by some slightly more sophisticated
capturing, along with a fixup script, which will come in a later PR

---

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-08-20 17:56:02 +00:00
Tom Houlé
1e9f1ef4d1
cloud_llm_client: Add Baseten language model provider (#62950)
Release Notes:

- N/A
2026-08-20 17:53:44 +00:00
Miguel Raz Guzmán Macedo
b427d4ecf0
Disable one-time code autofill in Zed text inputs (#60116)
Closes #46899

## Summary

- Set `NSAutoFillRequiresTextContentTypeForOneTimeCodeOnMac` in the
macOS Info.plist fragments
- Prevent macOS 26 Security Code AutoFill from appearing in regular Zed
text inputs unless explicitly annotated as one-time-code fields

## Testing

- Not run; Info.plist-only change

Release Notes:

- Fixed macOS showing one-time-code AutoFill suggestions in regular Zed
text inputs.
2026-08-20 17:53:01 +00:00
Daniel
cb1352a29d
Add configurable inline completion debounce timeout (#61568)
# Objective

Add configurable inline completion debounce timeout
Fixes/implements #23159

## Solution

I initially wanted to make a global setting for this, but it would
conflict with hardcoded debounces in codestral (150ms) and copilot
(75ms) which I assume are there for a reason.

So I ended up using the same mechanism used for the hardcoded debounce
in Codestral (`DEBOUNCE_TIMEOUT`) and Copilot
(`COPILOT_DEBOUNCE_TIMEOUT`)
and made it accessible and configurable for all providers.


Also fixed a bug with `DelayMs` `Display` trait adding "ms" into the
input field which then fails to parse something like "150ms" as a `u64`
by implementing `FromStr` which strips the "ms" suffix if present.

So now both "1000" and "1000ms" are parsed correctly and apply.

If the parsing fix is not relevant enough I can open a separate issue +
PR for that (and the inconsistent use and therefore display of
`Option<u64>` vs `Option<DelayMs>` in other ms input fields).

## Testing

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

Added a separate test which passes
`test_refresh_prediction_from_buffer_honors_debounce_duration`

Manually tested with openapi compatible prediction

All other tests in affected crates pass (`cargo test -p settings_content
-p settings_ui -p editor -p edit_prediction -p language
`)

#### How can other people (reviewers) test your changes? Is there
anything specific they need to know?

Open provider settings and adjust debounce, then see how long it takes
for a prediction to render.

#### If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?

Tested on Fedora 43 KDE, but it shouldn't matter as none of the affected
code is platform specific.

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


https://github.com/user-attachments/assets/14efa628-765e-4c2a-ac44-01aaa3657097

---

Release Notes:

- Added configurable inline completion debounce timeout, fixes #23159

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-08-20 16:42:42 +00:00
Jonas Lundholm Bertelsen
debf6b218c
cli: Fix Flatpak launcher argument ordering (#61577)
Closes https://github.com/zed-industries/zed/issues/62801

# Objective

Fix issue https://github.com/flathub/dev.zed.Zed/issues/395 (reported
against the flathub package, but as described in it, it was introduced
by https://github.com/zed-industries/zed/pull/57440 ).

The symptom was that when running `flatpak run dev.zed.Zed <project
path>` (or some alias), then you'd get two "files" opened `--zed` and
`zed-editor`, with `zed-editor` also being added to the Zed project list
in the open window, which was quite annoying.

## Solution

- The flatpak CLI launcher, which self-launches with potential extra
arguments, now puts those arguments first rather than last.

## Testing

- A simple unit test targets the helper function that adds the arguments
- It also verifies that the parsed args come out as expected

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

Note: I believe that other bullets than self-review and tests are not
relevant, as there is no unsafe, no expected performance impact, and no
UI changes.

---

Release Notes:

- Fixed an issue where Flatpak CLI launches would open
unrelated/nonexistent files due to a bug in argument construction

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-08-20 16:37:31 +00:00
mTvare
f4178619ac
gpui_linux: Drain buffered X11 events after foreground work (#62081)
# Objective

Closes #52429
Closes #56735
Closes #62495
Closes #62878

Reverts #13071

This PR fixes Zed windows sometimes remaining blank when first opened on
X11.

The issue remained very inconsistent across WMs and conditions to
reproduce and was finally consistently reproducable on my dwm build with
no compositor and on i3 with no compositor after removing the workaround
earlier added, which made it occur in i3 but not on my dwm build because
it was more aggressive with it's EWMH policy. It happened only on
opening a newer repo not opened the last time.

While running foreground work, a synchronous X11 request can read events
from the socket and place them in x11rb's internal event queue, calloop
monitors the underlying socket rather than this internal queue, so if
the socket is empty when the foreground work finishes, these events may
remain unprocessed until unrelated X11 activity occurs.

window is mapped -> events are buffered by x11rb
-> X11 socket is no longer readable
-> calloop does not wake
-> MapNotify is not processed
-> refresh loop does not start
-> window remains blank


This explains why the problem was inconsistent and differed between
window managers. Later focus, scrolling (on any window), exposure, or
other X11 activity could make the connection readable again and
incidentally process the older events.

My earlier PR #61162 fixed the related case where an already processed
`Expose` event could wait indefinitely for a stopped refresh loop. It
did not fix this initial-window case because the relevant events had not
reached Zed's event handler yet, which was again not perfectly
reproducable and lead me to assume was fixed.

## Solution

Process any X11 events buffered by x11rb after each foreground runnable
completes:

foreground work completes
-> buffered X11 events are processed
-> MapNotify starts the refresh loop
-> initial window contents are displayed

This also removes the unconditional
[`SetInputFocus`](https://tronche.com/gui/x/xlib/input/XSetInputFocus.html)
added in #13071. That call frequently masked the issue by generating
additional X11 activity, but also bypassed the window manager's focus
policy despite Zed already sending the standard `_NET_ACTIVE_WINDOW`
request.

With the event queue handled correctly, Zed no longer needs to force
focus to make the initial frame appear.

## Testing

Repeatedly opened fresh and existing workspaces under dwm while another
application retained focus with a new-project being opened everytime (at
least not the previous one).

Before this change, fresh windows could remain blank until later X11
activity occurred. After this change, they render immediately without
focusing, scrolling, resizing, or switching workspaces.

Also verified that window activation is left to the window manager
through `_NET_ACTIVE_WINDOW`.

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

* Fixed Zed windows sometimes remaining blank when first opened on X11
* Fixed Zed overriding window-manager focus policies when activating
windows
2026-08-20 15:01:09 +00:00
Xin Zhao
b0e37a6c18
Fix language server path displayed in LSP status tooltip (#62919)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
# Objective

Closes #52822

When hovering over the LSP status tooltip for a running language server,
the binary path is displayed. Currently, this tooltip shows
`LanguageServerBinary.path`. However, many language servers are executed
through runtimes such as Node or Python. For example, Zed-managed
`Basedpyright` produces a `LanguageServerBinary` like:
```Rust
LanguageServerBinary {
    path: "/usr/bin/node",
    arguments: [
        "/home/xin/.local/share/zed/languages/basedpyright/node_modules/basedpyright/langserver.index.js",
        "--stdio",
    ],
    env: ...
}
``` 
In this case, only `"/usr/bin/node"` is displayed, which doesn't convey
useful information about the actual language server script being
executed.

## Solution

There was a PR #53076 in which I was involved, and the solution there
was to populate every language server adapter with a special marker for
the path to be shown in the tooltip. That solution is accurate, but in
order to make this solution work for extension-provided servers, the
final diff became huge for a simple fix.

So here, as commented in
https://github.com/zed-industries/zed/pull/53076#pullrequestreview-4204849892,
a guess is performed by a newly introduced function
`tooltip_for_server_binary()` to get the real path to be shown. It may
have some edge cases, but works for current cases and is simple to
implement.

## Testing

Added new unit tests, built and tested locally, with the comparision
attached in the Showcase section.

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

For the mentioned `Basedpyright` language server case, the comparision
is shown below:
| Before | After |
|:--:|:--:|
| <img width="431" height="187" alt="before"
src="https://github.com/user-attachments/assets/0611f2fe-687b-4d67-ba78-380d89ed0212"
/> | <img width="582" height="185" alt="after"
src="https://github.com/user-attachments/assets/6ad08720-ac53-4b2d-a72c-3febb441e2f1"
/> |

---

Release Notes:

- Improved the LSP status tooltip to display the target script path for
runtime-managed language servers
2026-08-20 12:47:15 +00:00
Frank Loesche
53b39e8e89
worktree: Fix global gitignore matching outside the worktree root (#62130)
# Objective

When a worktree has no enclosing git repository, the `global-gitignore`
check falls back to matching the raw, unbounded absolute path. This lets
an ancestor directory outside the worktree, or the worktree's own root
name, incorrectly match a bare global-ignore pattern (e.g. a global
entry like `tmp` or `*.com`) and mark the entire worktree as ignored,
which silently breaks project search and greys out every file in the
project panel.
  
Fixes #62126
Fixes #48887

## Solution

- In `Snapshot::ignore_stack_for_abs_path`, when no containing
repository is found, fall back to the worktree's own root as the
boundary for `IgnoreStack.repo_root`, instead of leaving it `None`.
- This reuses the existing repo-root-relative matching logic in
`IgnoreStack::is_abs_path_ignored` (already correct for the
git-repository case since #61689) without needing any changes to
`ignore.rs` itself: ancestors outside the worktree now correctly fail
the prefix check and are treated as not ignored, while the global
gitignore still applies to files and directories within the worktree.

## Testing

- Added `test_global_gitignore_without_repository` in
`crates/worktree/tests/integration/worktree_tests.rs`, covering both
variants in one worktree: an ancestor directory outside a non-git
worktree matching a global pattern, and the worktree's own root name
matching one, while also confirming a file that matches the pattern from
within the worktree is still ignored.
- Verified the new test fails without the fix (reproducing both #62126
and #48887) and passes with it.
- Ran the full `worktree` integration test suite (`cargo test -p
worktree --test integration`); all tests pass.
- Not tested on Windows or macOS, only Linux.

## Self-Review Checklist:

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


---

Release Notes:

- Fixed global gitignore entries incorrectly matching directories
outside the opened project and marking the entire project as ignored

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-08-20 12:29:17 +00:00
Lena
2b37a3ed5e
Update issues link in CONTRIBUTING.md (#62937)
We've merged two `.contrib` labels.

Release Notes:

- N/A
2026-08-20 12:23:30 +00:00
Kirill Bulatov
deb194b49b
Properly deduplicate overlapping range formatting results (#62935)
Fixes https://github.com/zed-industries/zed/issues/62780

When formatting changed-only regions, we have received formatting
changes that are larger than the regions submitted.
Previous code merged only adjacent hunks in a single response, without
merging anything else, e.g. multiple responses' ranges that overlapped.

Release Notes:

- Fixed overlapping range format results duplicating the text
2026-08-20 12:15:06 +00:00
Shuhei Kadowaki
c3b365d276
agent_ui: Fix inline assistant when reasoning precedes tool use (#61220)
The inline assistant's streaming-tool path waited for the first
`rewrite_section` output, but treated any other completion event as
terminal. Responses API providers can emit `ReasoningDetails`,
`Thinking`, and other metadata before the tool call. This stopped the
stream early and marked generation as done without applying a
replacement.

EOF was not handled explicitly. Parse errors, provider errors,
incomplete tool calls, and truncated responses could also be reported as
successful completions.

Continue consuming informational events until a supported tool call
arrives. Track the rewrite tool call's streaming state, reject a second
`rewrite_section` call instead of concatenating unrelated outputs,
accept `failure_message` only after its input is complete, and reject a
`rewrite_section` arriving after a failure message (and vice versa).

Stop, EOF, malformed tool input, and stream errors now surface as
`CodegenStatus::Error` instead of silently completing. A completed tool
call followed by `Stop(MaxTokens)` or `Stop(Refusal)` is also an error:
the OpenAI Responses mapper flushes truncated tool calls as complete
before emitting the stop reason, so the stop reason must be checked even
when the tool input parsed. Completed failure messages are stored before
`Finished` is emitted, and a failure message left over from a previous
generation is now cleared when a new one starts.

Add regression coverage for metadata around streamed rewrites, Stop and
EOF without a tool call, incomplete rewrites, interrupted responses,
multiple rewrite calls, failure messages, malformed input, mixed tool
calls, and stream errors before and after rewrite output begins.

---

Closes #52714

Release Notes:

- Fixed the inline assistant doing nothing when the model emits
reasoning before its tool call.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-08-20 11:48:31 +00:00
Anıl Zeybek
09adbb01f6
workspace: Persist recent navigation history across sessions (#55034)
Saves the recent navigation history (up to 20 entries) to the workspace
DB so it survives restarts. When reopening a workspace, persisted paths
that resolve to the current project are merged into the file finder's
history, deduplicated against files already opened in the session.


https://github.com/user-attachments/assets/3d8934e1-0da6-4445-8f3d-acc5597d7ac8

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: https://github.com/zed-industries/zed/issues/56271

Release Notes:

- Improved file finder history to include recently opened files from
previous sessions.
2026-08-20 11:27:03 +00:00
Dino
58006060d1
project_panel: Remove directories created by rename on undo (#60082)
# Objective

When an user uses the Project Panel to rename a file, it is possible to
change its path too. For example, renaming `README.md` to
`documents/README.md` will create the `documents/` directory, in case it
doesn't yet exist.

Unfortunately, even though undoing a rename operation is already
supported, we were not yet considering this scenario where directories
had been created specifically to support the rename. As such, when undo
was used, for the scenario above, we'd end up moving `README.md` back to
its original location but would leave the empty `documents/` directory
behind.

## Solution

Introduce two new operations and changes specifically for this use-case,
`Operation::CreateDir`, `Operation::RemoveDir`, `Change::DirCreated` and
`Change::DirRemoved`, which we can then batch together with the
`Operation::Rename` in case directories need to be created or removed.

An initial approach of just keeping the list of created directories in
the `Operation::Rename` and `Change::Renamed` variants was considered
but it would require all users of `Operation::Rename` to now set it,
even if they don't actually need it, like the drag and paste operations.
Having separate operations and change variants also makes it clearer
what these are meant to be used for.

Something else worth noting is that, for `Operation::CreateDir`, the
directory will only be created if it doesn't yet exist, otherwise we'll
ignore. Same happens for `Operation::RemoveDir`, where if the directory
is not empty, we don't delete it, as it's possible for new files to have
been added to the directory outside of Zed and we don't want to delete
those.

## Testing

Tested both manually as well as introduced a new test case
– `project_panel::tests::undo::rename_with_dir_undo_redo` .

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

## 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>Before</summary>


https://github.com/user-attachments/assets/15384fa8-9b94-495c-8992-19eee7a8f038
</details>

<details>
  <summary>After</summary>


https://github.com/user-attachments/assets/c5be9f38-a2b4-4acc-8a1e-178161e326bb
</details>

---

Release Notes:

- Fixed undoing a file rename leaving behind directories created by the
rename.
2026-08-20 11:25:47 +00:00
Artem Petryakov
3ea4d186a1
Deduplicate worktree entries from LSP paths with mismatched casing (#61392)
# Objective

On case-insensitive volumes (the macOS default), language servers may
return `Location` URIs whose path casing differs from the worktree's
stored casing - e.g. `Utils/helpers.py` when the on-disk (and worktree)
path is `utils/helpers.py`. `LspStore::open_local_buffer_via_lsp` used
the LSP path verbatim, and worktree selection
(`WorktreeStore::find_worktree`) does a case-sensitive prefix match, so
the existing worktree was either missed (creating a duplicate invisible
worktree) or matched but with a relative path that retained the LSP's
intermediate-component casing. That relative path was then used to
`load_file`, which inserted a brand-new `Entry` keyed by the
differently-cased path alongside the existing one - producing duplicate
file entries in the project panel. This was most visible when navigating
Python imports (Go to Definition) where the LSP returned
differently-cased paths.


https://github.com/user-attachments/assets/e36930b5-8dfd-4b43-8fe4-5317d401e198

## Solution

Canonicalize the LSP-provided absolute path via `fs.canonicalize` before
the worktree lookup in `LspStore::open_local_buffer_via_lsp`, so the
path casing matches the filesystem and the existing worktree/entry is
reused. Canonicalization failures (e.g. a path that doesn't exist on
disk yet) fall back to the original path to preserve prior behavior.

To enable testing this on a fake filesystem, `FakeFs` now supports
`set_case_sensitive(false)` and its `canonicalize` resolves names
case-insensitively, returning the stored (canonical) casing.

## Testing

Added `test_open_buffer_via_lsp_case_variant_no_duplicate` in
`crates/project/tests/integration/lsp_store.rs`. It opens a buffer via
an LSP URI with differently-cased intermediate component
(`/root/SRC/main.rs` vs `/root/src/main.rs`) on a case-insensitive
FakeFs and asserts that no differently-cased entry is created and the
canonical entry is preserved. Verified the test fails without the fix
(`SRC/main.rs` duplicate appears) and passes with it. Existing worktree,
fs, and project_panel test suites remain green.


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


https://github.com/user-attachments/assets/f052cf10-8b45-4547-8425-00ce4050ee7c

---

Release Notes:

- Fixed duplicate file entries in the project panel on macOS when
navigating to definitions via the language server returned paths with
different casing than the worktree root.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-08-20 11:19:14 +00:00
xdBronch
dbdcb310d1
Respect lsp_results_location for declaration and type definition (#61060)
# Objective
use pickers for all kinds of lsp definitions

## Solution

add handlers for `GoToDeclaration` and `GoToTypeDefinition` in
`lsp_locations.rs`

## Testing

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

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

## Showcase

this rust code can be used to test for multiple type definitions on `a`
```rs
macro_rules! foo {
    ($e:ident) => {
        let $e: Vec<()>;
        let $e: String;
    };
}
fn main() {
    foo!(a);
}
```
<img width="735" height="288" alt="image"
src="https://github.com/user-attachments/assets/578e6dc2-b201-4194-bd8b-e8d17b4d3d50"
/>

---

Release Notes:

- Respect `"lsp_results_location": "picker"` for go to declaration and
type definition
2026-08-20 11:17:57 +00:00
Neel
1b04e4caf0
Stop bundling GLib in Linux release archives (#61593)
Bundled GLib shadowed the system libraries for host plugins dlopen'd
into the process, like PipeWire's videoconvert on 1.6+, which would
break Wayland screen sharing on newer distros. This PR makes Zed rely on
system GLib instead, since the bundled version pulls from whatever is in
CI (presently Ubuntu 20.04).

Release Notes:

- Removed GLib libraries from Linux release bundle, which could conflict
with system plugins
2026-08-20 10:20:14 +00:00
Neel
282f47a544
Switch from cargo-machete to cargo-shear (#62643)
This results in ~110 crates being removed, and some orphaned files also.

---

Release Notes:

- N/A

Signed-off-by: Neel <neel@zed.dev>
2026-08-20 10:08:48 +00:00
Josh Ellithorpe
4d1935b8d0
gpui_linux: Clear X11 urgency hint when the window becomes active (#61619)
# Objective

On X11, GPUI raises the ICCCM `WM_HINTS` urgency flag to ask for
attention, but
it never clears it. The window stays urgent for the rest of its life.

`request_attention` was the only thing touching the bit. There was no
code
anywhere to clear it.

Docks and taskbars latch on the rising edge, so they show the attention
state
once and then sit there with a permanent urgent indicator, no further
notifications.

## Solution

Clear the flag when the window becomes active.

The read/modify/write moves out of `request_attention` into a helper,
`set_wm_hints_urgency(xcb, x_window, urgent)`. The raise and clear sites
are on
different self types (`X11Window` vs `X11WindowStatePtr`), so it takes
the
connection and window id.

The clear goes in `set_wm_properties`, where `state.active` gets set
from
`_NET_WM_STATE_FOCUSED`. That's the same field `request_attention`
already checks
in its `if self.is_active() { return; }` guard.

Two implementation notes:

* The clear is edge triggered (`state.active && !was_active`).
`set_wm_properties` recomputes everything on every `_NET_WM_STATE`
change, so a
level triggered check would do a blocking `WmHints::get` round trip on
every
maximize, fullscreen, hide and workspace switch while focused. Edge
triggering
is safe here because `request_attention` early returns when active, so
urgency
only ever gets raised while inactive, and the false to true transition
always
  follows a raise.
* Clearing reads the hints first and skips the write if the bit isn't
set.
Otherwise focusing a window that never asked for attention would create
a
  `WM_HINTS` property just to say "not urgent".

The raise path behaves exactly as before. The skip can't fire when
`urgent` is
true, so repeat raises still write every time.

Focusing clears the flag even if a second thread is still waiting.
That's already
how it works, since `request_attention` early returns when the window is
active.

## Testing

Tested on X11, Cinnamon with Muffin.

On an unpatched build the window had `_NET_WM_STATE_FOCUSED` and the
urgency bit
set at the same time.

    W=$(xdotool search --class "dev.zed.Zed" | head -1)
    xprop -id $W WM_HINTS
    xprop -spy -id $W WM_HINTS

1. Fresh window says `WM_HINTS: not found`, and still does after
focusing it.
2. With focus on another window, the urgency bit shows up when attention
is
requested. `request_attention` early returns when active, so the window
has to
   be unfocused for this to fire.
3. Focusing Zed clears the bit.
4. Repeating 2 and 3 re-arms it every cycle, not just once.
5. No `WM_HINTS` writes during normal use (resize, maximize, workspace
switch).

No automated test. It's an X11 round trip on a real window and there's
no X11
test harness in the tree.

## Self-Review Checklist:

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

Note this was manually tested, there wasn't a good way to test it
through the current harness.

---

Release Notes:

- Fixed the X11 urgency hint never being cleared, which left Zed showing
a permanent attention indicator in taskbars and docks after the first
notification
2026-08-20 08:52:37 +00:00
Ali
cef06d351b
worktree: Yield during large file decoding (#62831)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
# Objective
Closing a project while a large local text file is loading can be
delayed
because file-reading and UTF-8 streaming loops have no await points.

Partially addresses #27283.
## Solution

Yield between 1 MiB blocks while:
- streaming UTF-8 files into a Rope
- reading files handled by the fallback decoder, including BOM, UTF-16,
  and other non-UTF-8 encodings

Release Notes:

- Improved responsiveness when closing projects that are loading large
text files.
2026-08-20 06:04:08 +00:00
Xiaobo Liu
a58fff1334
zed: Support IPv6 hosts in SCP-style SSH URLs (#62157)
# Objective

- Support opening remote paths from SCP-style SSH URLs that use
bracketed IPv6 hosts, such as `ssh://[2600::]:~/foo`.

## Solution

- Validate SSH hosts with `url::Host::parse`, which supports bracketed
IPv6 addresses while continuing to reject malformed or ambiguous hosts.
- Add test coverage for IPv6 URLs with usernames, home-relative paths,
absolute paths, and explicit ports.
- Add rejection tests for unbracketed IPv6 addresses and ambiguous
port-plus-SCP-path syntax.

## Testing

- Ran `cargo fmt --all -- --check`.
- Ran `cargo test -p zed test_parse_ssh_urls -- --nocapture`.
- Ran `cargo test -p zed test_reject_ssh_urls -- --nocapture`.
- All targeted tests passed on macOS. No additional platform-specific
testing is expected to be necessary because the change only affects URL
parsing.

Release Notes:

- Fixed opening remote paths from SCP-style SSH URLs with IPv6 hosts.

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
2026-08-20 05:39:38 +00:00
Andrej730
32a0e813a5
keymaps: Sync debugger bindings across platforms to match VS Code (#58729)
I was trying out zed after VS Code and I've stumbled upon inconsistency
with debugging hotkeys.
In VS Code it's f10/f11, in zed it was much more awkward f7/ctrl-f11. 

Investigating, I've found that I can't just override f11, because it's
used by `zed::ToggleFullScreen` global hotkey and global hotkey always
beats `Workspace && debugger_stopped`.
Furthermore, I've found f11 hotkey is available, but only on Mac. And on
Windows there was no `StepInto` hotkey at all. So configs were unsynced
in that regard.

Code changes:

- To make f11 overridable, I've moved it to `Workspace` context - it's
still pretty global, but now it's overridable. Though `Workspace &&
debugger_stopped` have the same depth as `Workspace`, it will take
priority, because it's registered later in .json.

- StepInto - added f11 hotkey for all platforms (was missing on linux
and windows), kept older ctrl-f11 too as some users might be used to it.
A note that on Mac F11 was added previously as `Workspace &&
debugger_running` - which practically means the hotkey wasn't available.
`debugger_running` means debugger is running in background, user needs
step commands when `debugger_stopped`- when they're actually stepping
through the code.

- StepOver - added f10 hotkey for all platforms (was missing on linux
and mac). Kept old f7 hotkey on linux and mac, didn't added it on
windows as it wasn't present before.

- StepOut - it was consistently shift-f11 on all platforms already, just
moved it from global context for consistency.

- Removed StepOver, StepInto, StepOut from debugger_session context and
kept it only in `debugger_stopped`, as this is when they're actually
useful, similar to how we have `debugger::Continue"` there which also
makes sense only when debugger is stopped.

I've separated changes by commits, so it would be easier to review them.

PS Global hotkeys overriding specific ones seems a bit odd by itself -
it seems global more specific hotkeys should always have a priority, so
maybe it's something to look into too.
Another thing that `default-xxx.json` share a lot of hotkeys, so
maintaining them separately may have other things going out of sync too.

Closes #58899.

----

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 - keymaps are not tested
- [x] Performance impact has been considered and is acceptable


Release Notes:

- Improved debugger step keybindings across platforms to match VS Code
defaults while preserving fullscreen outside paused sessions

---------

Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
2026-08-20 00:48:05 +00:00
Finn Evers
6e0a083575
ci: Acquire ts_query_ls using the gh CLI instead (#62900)
Release Notes:

- N/A
2026-08-19 22:28:55 +00:00
Gary Guo
2bf9e26473
terminal: Fix support for alt-f5 and add support for ctrl-alt-key (#62891)
# Objective

- Fix support for alt-f5 in terminal and add support for ctrl-alt-key

## Solution

- Fix `crates/terminal/src/mappings/keys.rs`.

## Testing

- Did you test these changes? If so, how? Added a unit test, and test
the built zed with fish_key_reader to check that the keys are indeed
recognized.
- Are there any parts that need more testing? No
- How can other people (reviewers) test your changes? Is there anything
specific they need to know? Fish has fish_key_reader which can check the
keys that it recognizes. Not sure about other shells. `cat | xxd` can be
used to confirm the exact received key codes.
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test? Tested on Linux only.

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

- In terminal, "alt-f5" keystroke support is fixed and "ctrl-alt-key"
support is added for letter keys.

---------

Signed-off-by: Gary Guo <gary@garyguo.net>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-08-19 22:17:41 +00:00
Torbjørn Lium
6a37cc1173
Add Python runnable for __name__ in ("__main__",) pattern (#58911)
The gutter run button for Python's main guard only appears for `if
__name__ == "__main__":` but not for the alternative membership test
pattern `if __name__ in ("__main__", "__builtin__", "builtins"):`.

This adds a second Tree-sitter query in `runnables.scm` that matches the
`in` variant. It emits the same `python-module-main-method` tag, so both
patterns get the same gutter icon and task behavior.

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 (No dedicated tests for the
Python runnables queries exist. The build passes cleanly)
- [x] Performance impact has been considered and is acceptable

Closes #58909

Release Notes:

- Fixed Python run button not appearing in the gutter for `if __name__
in ("__main__", ...)` style main guards.

Co-authored-by: Finn Evers <finn@zed.dev>
2026-08-19 22:16:44 +00:00