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
Closes#55619
### Summary
- Route `buffer_search::UseSelectionForFind` through
`BufferSearchBar::deploy` instead of updating the query editor directly.
- Add an explicit seed-query override to `deploy`, so the Cmd-E action
can force `SeedQuerySetting::Always` while regular deploy callers
continue to pass `None` and respect the user’s
`seed_search_query_from_cursor` setting.
- By going through `deploy`, Cmd-E now also runs the search path that
keeps buffer-search navigation state in sync:
- shows/initializes the search bar for the active searchable item
- applies the seeded query via `search_suggested`
- calls `search`, which updates the query editor, search options, active
search query, search history, and macOS find pasteboard
- refreshes `searchable_items_with_matches` and `active_match_index`
- activates the current match after the search completes
- This ensures the subsequent Cmd-G action has the expected active
query, match list, search token, and active match index to select the
next result.
- Add a macOS-only end-to-end regression test using the default macOS
keymap with `simulate_keystrokes("cmd-e")` and
`simulate_keystrokes("cmd-g")`.
### Validation
- `cargo test -p search test_cmd_e_then_cmd_g_uses_selection_for_find`
- `cargo fmt --check --package search --package zed_actions`
- `./script/check-keymaps`
- `cargo check -p search`
- `cargo check -p workspace`
- `cargo check -p vim`
Release Notes:
- Fixed macOS Cmd-E/Cmd-G find behavior so Cmd-E seeds find from the
cursor or selection and Cmd-G advances through the newly seeded matches.
Experiment with allowing users to manage terminal sessions along with
threads in the sidebar.
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: Bennet Bo Fenner <bennetbo@gmx.de>
This adds the functionality to support pasting the file path of an item
when the copied item supports it. This mirrors the behavior of
`Terminal.app` on macOS.
This only implements the functionality on macOS but could be extended to
other platforms.
I find this convenient when I'm using Finder to navigate around the file
system and I want to copy a directory or file path and put it in the
terminal. You can copy the item from Finder and paste it into the
terminal and it will write out the full path of the item, making it easy
to change directories or provide path parameters to commands.
Release Notes:
- Added path pasting functionality in terminal
Right now the terminal rendering code applies a minimum contrast value
(which is good, and for accessibility) to colors that appear, there was
already an exemption from this for 24bit color specification, because
the application explicitly asked for that color, so it should be
rendered that color.
My change changes that exemption to also include ansi colors 16-255,
because these are also set explicitly, the normal, non-exempt case is
now the default ansi colors, 0-15, these are set by the theme and are
usually specified as just 'red' or 'green', hence the importance of the
min contrast.
Heres what the gradient ramp from the original issue looks like now:
<img width="944" height="1123" alt="Screenshot 2026-04-22 at 6 45 43 PM"
src="https://github.com/user-attachments/assets/918d62db-ed8e-475c-9ec1-c60187ad4b5e"
/>
This matches ghostty and VSCodium from the original issue.
test prevents regressions but idk, maybe not nessecary.
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#54396
Release Notes:
- terminal: Improved 256 color ansi rendering
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
This fixes an issue where due to the scrollbar appearing, the reported
content size would shift, causing issues in the process. We now actually
always reserve space for the scrollbar appropriately as described in
https://github.com/zed-industries/zed/pull/33636 initially.
Release Notes:
- Fixed an issue where the scrollbar could cause a layout shift in the
terminal.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Painting primitives at non-integer pixel coordinates produces blurry
output. Pixel snapping converts layout coordinates into integer
device-pixel coordinates so painted edges land exactly on physical pixel
boundaries.
Non-integer coordinates can arise for several reasons, including:
- flex distribution, percentages, centering, and text measurement can
produce fractional element sizes and positions;
- at fractional scale factors (for example 125% or 150%), integer
logical-pixel values can map to non-integer device-pixel values.
We pixel-snap by rounding in device-pixel space, after multiplying by
`scale_factor`, so that snapping targets physical pixels. Bounds are
divided by `scale_factor` before being returned to GPUI.
Midpoints are rounded toward zero. This is a stylistic choice: a
1-logical-pixel line at 150% scale should render as 1 dp rather than 2
dp.
Pixel snapping is done in two phases:
1. Pre-layout metric snapping. Before Taffy computes layout, all
authored absolute lengths are rounded in `to_taffy`. This includes
borders, padding, gaps, and explicit sizes. Custom-measured leaf nodes
have their measured sizes rounded up to integer device-pixel lengths.
2. Post-layout edge snapping. After Taffy resolves the tree, layout
relationships such as flex shares, grid tracks, percentages, and
centering can produce new fractional edge positions. Boxes now have
edges in absolute coordinates, and snapping must decide where those
edges land on the device-pixel grid.
Ideally, post-layout snapping would satisfy:
- Edge closure. Two raw layout edges at the same absolute position
should snap to the same pixel column.
- Translation stability. A component's internal geometry should not
change when it moves to a new absolute position.
These goals are in tension because rounding is not associative. The
simple local schemes make different tradeoffs:
- Absolute edge rounding gives each window coordinate one answer, so
coincident edges always close globally. But a span's snapped length is
`round(far) - round(near)`, which may change by 1 dp as its absolute
origin moves.
- Parent-relative edge rounding rounds each child inside its parent's
coordinate space. This guarantees translation stability, but a shared
edge reached through different parents can accumulate different
rounding, causing non-closure between cousins.
- Length rounding rounds each width, height, and thickness independently
and then places boxes from those rounded lengths. Sizes stay stable
under translation, but neighboring boxes derive their shared boundary
from different sources, so closure is not guaranteed.
We apply absolute edge rounding for each element's outer box in
post-layout rounding to preserve closure. Border and padding widths are
not touched by post-layout rounding; they keep their pre-layout rounded
value so that they remain stable under translation.
This gives both closure and translation stability in the case that all
local metrics are integer device-pixel lengths. Pre-layout rounding
covers that in most cases. The exception is metrics resolved by layout
relationships, such as percentages. Outer box edges will still close
globally, and painted border widths are still snapped independently, but
the raw content-box origin can carry a 1 dp residual into descendants.
---
Fixes https://github.com/zed-industries/zed/issues/46360
Fixes https://github.com/zed-industries/zed/issues/44528
Fixes https://github.com/zed-industries/zed/issues/40282
Fixes https://github.com/zed-industries/zed/issues/42257
---
Release Notes:
- Fixed potentially blurry appearance of UI elements when using
fractional display scaling.
No, sadly, the title is not a typo. See
https://www.githubstatus.com/incidents/zsg1lk7w13cf for the context.
I'll read with joy and popcorn through that root cause analysis.
It makes literally zero sense what happened here, but for some completly
bonkers reason GitHub completely messed up the merge queue with
https://github.com/zed-industries/zed/pull/54632.
I have no idea how it happened. It makes literally zero sense. A PR
going into the merge queue should have the same LoC when getting out of
it. GitHub obviously does not check this. GitHub causes extra work with
a feature that is supposed to save time.
Thanks, I guess.
Release Notes:
- N/A
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This PR brings back the button to filter remote branches when accessing
the title bar's branch picker with the mouse. It was unintentionally
removed when we introduced the new worktree picker.
Release Notes:
- N/A
Closes#50844
## Summary
- When right-clicking a word in the terminal with no prior selection,
`select_word_at_event_position` queues the selection as an
`InternalEvent` that only syncs to `last_content` on the next update
cycle.
- The context menu was reading `last_content.selection_text` before the
sync, so "Add to Agent Thread" was missing until the second right-click.
- Pass `has_selection` into `deploy_context_menu` from the call site,
where we already know whether a word was just selected.
## Test plan
- [x] Open a terminal in Zed
- [x] Run a command that produces output (e.g. `echo foo bar baz`)
- [x] Ensure there is no existing selection
- [x] Right-click on a word — "Add to Agent Thread" appears on the first
right-click
- [x] Right-click with an existing selection — "Add to Agent Thread"
still appears
- [x] Right-click with no text under cursor — context menu still works
correctly
## Videos:
### Before
[agent_test_before.webm](https://github.com/user-attachments/assets/d913a05b-6189-40a4-8eee-3660be8c3647)
### After
[agent_test_after.webm](https://github.com/user-attachments/assets/ceacc617-71b2-442f-a150-305867f9dd5f)
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- Fixed "Add to Agent Thread" missing from terminal context menu on
first right-click when no prior selection existed.
---------
Co-authored-by: Lukas Wirth <lukas@zed.dev>
When opening a terminal in a remote project, skip local-only path
operations (home dir fallback, shell expansion, is_dir checks) so the
remote shell opens in the remote user’s home directory by default.
Closes#49613.
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- Prevent local path resolution for remote terminals
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
Followup to #47531 to use the gpui feature in Zed. This just plumbs the
"system bell" feature into the terminal, behind a new setting (enabled
by default, like most other terminal applications).
Closes#5303
Relates to
https://github.com/zed-industries/zed/issues/40826#issuecomment-3684556858
Release Notes:
- Added audible BEL to Terminal; can be enabled by setting
`terminal.bell` to `"system"`.
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Ben Kunkle <Ben.kunkle@gmail.com>
When opening a remote session, sometimes you get a message:
/bin/bash: line 1: cd: /Users/pep: No such file or directory
which suggests that that the local home dir (/Users/pep) is used for the
remote terminal session, where it should be something like /home/ubuntu.
Release Notes:
- Fixed remote terminals incorrectly trying to change to a local home
directory.
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
- [X] Performance impact has been considered and is acceptable
## What
When terminal cursor shape is set via escape sequences (e.g. `\e[6 q`
for bar, `\e[4 q` for underline), the cursor looks identical whether the
terminal is focused or unfocused. Block cursors already convert to a
hollow outline when unfocused, but bar and underline were missing this
treatment.
## How
Added unfocused guards for `Beam` and `Underline` in the cursor shape
match in `terminal_element.rs`, converting them to `Hollow` when the
terminal loses focus. This follows the same pattern already used for
`Block`.
## Why this approach
A hollow block outline is the clearest unfocused signal and stays
consistent with the existing Block behavior. Alternative approaches like
dimming opacity or drawing outlined versions of bar/underline were
considered, but a 2px-wide outlined bar would be nearly invisible at
normal font sizes.
## Demo:
Before:
https://github.com/user-attachments/assets/81d49899-0837-42fe-a68f-4eb745892af6
After:
https://github.com/user-attachments/assets/a4444e28-5835-4c9f-872f-e9ce8c4805a0Closes#52716
Release Notes:
- Fixed terminal bar and underline cursors set via escape sequences not
visually distinguishing between focused and unfocused states
## Context
Red and blue have inherently low perceptual luminance in APCA — pure
default Lc 45 threshold. This caused ensure_minimum_contrast to lighten
them, washing out the color to pink/lavender.
When an application explicitly specifies an RGB value via
ESC[38;2;R;G;Bm,
that color should be rendered as-is. Named and indexed colors continue
to be contrast-adjusted since they come from theme mappings
[zed-colors-before.webm](https://github.com/user-attachments/assets/1adb8c95-5dec-4744-b6f8-38f085602ef4)
[zed-colors-after.webm](https://github.com/user-attachments/assets/1968db26-9c02-48cf-9542-86a6c39899c0)
Closes: #50396
<!-- What does this PR do, and why? How is it expected to impact users?
Not just what changed, but what motivated it and why this approach.
Link to Linear issue (e.g., ENG-123) or GitHub issue (e.g., Closes#456)
if one exists — helps with traceability. -->
## Self-Review Checklist
<!-- Check before requesting review: -->
- [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:
- Fixed true-color render in terminal
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"
/>
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#53056.
Release Notes:
- Fixed terminal tabs losing keyboard focus after switching tabs on Linux X11
Context
The markdown preview had no search functionality — pressing Ctrl+F did
nothing. This PR implements the SearchableItem trait for
MarkdownPreviewView, enabling in-pane text search with match
highlighting and navigation.
Changes span four crates:
- project: Added SearchQuery::search_str() — a synchronous method to
search plain &str text, since the existing search() only works on
BufferSnapshot.
- markdown: Added search highlight storage to the Markdown entity and
paint_search_highlights to MarkdownElement. Extracted the existing
selection painting into a reusable paint_highlight_range helper to avoid
duplicating quad-painting logic.
- markdown_preview: Implemented SearchableItem with full match
navigation, active match tracking, and proper SearchEvent emission
matching Editor behavior.
- Keymaps: Added buffer_search::Deploy bindings to the MarkdownPreview
context on all three platforms.
The PR hopefully Closes
https://github.com/zed-industries/zed/issues/27154
How to Review
1. crates/project/src/search.rs — search_str method at the end of impl
SearchQuery. Handles both Text (AhoCorasick) and Regex variants with
whole-word and multiline support.
2. crates/markdown/src/markdown.rs — Three areas:
- New fields and methods on Markdown struct (~line 264, 512-548)
- paint_highlight_range extraction and paint_search_highlights (~line
1059-1170)
- The single-line addition in Element::paint (~line 2003)
3. crates/markdown_preview/src/markdown_preview_view.rs — The main
change. Focus on:
- SearchEvent::MatchesInvalidated emission in schedule_markdown_update
(line 384)
- EventEmitter<SearchEvent> and as_searchable (lines 723, 748-754)
- The SearchableItem impl (lines 779-927), especially active_match_index
which computes position from old highlights to handle query changes
correctly
4. Keymap files — Two lines each for Linux/Windows, one for macOS.
Self-Review Checklist
- [ x ] I've reviewed my own diff for quality, security, and reliability
- [ x ] Unsafe blocks (if any) have justifying comments (no unsafe)
- [ x ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
(should be 😄 )
- [ - ] Tests cover the new/changed behavior (not sure)
- [ - ] Performance impact has been considered and is acceptable (I'm
not sure about it and it would be nice to see experienced people to
test)
Release Notes:
- Added search support (Ctrl+F / Cmd+F) to the markdown preview
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
🫡
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:
- Removed legacy Text Threads feature to help streamline the new agentic
workflows in Zed. Thanks to all of you who were enthusiastic Text Thread
users over the years ❤️!
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
- **Remove some of the settings types from ui**
- **drag settings-less ui across the line**
Self-Review Checklist:
- [ ] 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
Closes #ISSUE
Release Notes:
- N/A
---------
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
This PR adds the ability to change both the terminal and agent panels
between fixed and flexible sizing using the status bar button right
click menu. The value persists in your settings, similar to the dock
position.
I've also slightly tweaked the styling of the "Dock Left" and "Dock
Right" items in the right-click menu, adding the current value as an
item with a check beside it, to make it clear that it's a selectable
option.
Release Notes:
- N/A
## Context
Fixes#52063
This change hides the cursor in embedded terminal mode when not focused.
Embedded mode is used for read-only terminal output (like the Agent
panel). Showing a cursor in a read-only context when unfocused is
confusing, so we suppress it.
<img width="549" height="496" alt="Screenshot 2026-03-25 at 12 03 15"
src="https://github.com/user-attachments/assets/20b29c28-85a7-4f5e-87ea-acf47d15d506"
/>
## How to Review
The change is in a single file:
`crates/terminal_view/src/terminal_view.rs:754-761`.
Focus on the `should_show_cursor()` method
Verify the logic correctly hides the cursor only when both conditions
are met (Embedded mode AND not focused).
## Self-Review Checklist
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments (N/A - no unsafe
code)
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior (behavior is minimal UI fix,
existing tests should cover)
- [x] Performance impact has been considered and is acceptable
(negligible)
Release Notes:
- Fixed cursor visibility issue in embedded terminal panels
Self-Review Checklist:
- [ ] 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
Closes #ISSUE
Release Notes:
- N/A
## Context
This adds a setting for controlling the sidebar side
## Self-Review Checklist
<!-- Check before requesting review: -->
- [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: Eric <eric@zed.dev>
Follow-up to the discussion in #51670.
@ConradIrwin, thanks for the review!
You're right about the other editors. VS Code and JetBrains use
dedicated shortcuts for bottom panel tabs, which exactly mirrors how
`ctrl-`` already behaves in Zed, so we don't need a new keybinding.
The reason I originally proposed `cmd-shift-j` was just to match the UI
pattern of the Debugger, which clearly shows `cmd-shift-d` on hover.
Because of a minor UI discoverability bug, the Terminal button's tooltip
was completely blank, which made it look like it just lacked a shortcut
entirely.
It turns out the Terminal button's internal `toggle_action()` method was
just telling the UI to look up `ToggleFocus` instead of
`terminal_panel::Toggle` (which is what `ctrl-`` is actually bound to).
I've updated this branch with a simple one-word fix that just points the
`toggle_action` to the correct keymap. The existing `ctrl-`` shortcut
now shows up perfectly in the hover tooltip. Good catch on the existing
shortcuts, keeps this much cleaner.
Co-authored-by: Michael Smolkin <msmolkin@users.noreply.github.com>
Related to #31504
## Problem
If you drag a terminal into the center editor area as a tab, pressing
`Cmd+N` still opens the new terminal in the terminal panel instead of
next to the tab you're looking at.
## Solution
`Cmd+N` now checks whether the center pane is focused and its active tab
is a terminal. If both are true, the new terminal opens there. All other
behavior is unchanged.
https://github.com/user-attachments/assets/01036cb4-5f1f-456e-900e-eed2e53d61f5
## Test plan
- [ ] Drag a terminal into the center editor area. Focus it. Press
Cmd+N. New terminal opens as a center tab.
- [ ] Toggle terminal panel with Ctrl+`. Press Cmd+N. Opens in panel as
before.
- [ ] Focus a regular code file. Press Cmd+N. Opens in panel as before.
- [ ] Have a terminal in the center, but focus the terminal panel. Press
Cmd+N. Opens in panel as before.
Release Notes:
- Improved `terminal: New Terminal` (Cmd+N) to open in the center pane
when a terminal tab there is focused, instead of always opening in the
terminal panel.
- Simplify and improve Windows clipboard handler.
- Fixed components that weren't handling multiple formats on the
clipboard properly.
Closes https://github.com/zed-industries/zed/issues/51278
Release Notes:
- windows: Fixed an issue where text copied from Office applications
couldn't be pasted into Zed.
All of the important changes are in
[`db.rs`](https://github.com/zed-industries/zed/pull/51809/changes#diff-2f644eab943bfa58feec29256281a3d9e8d4d7784cd34783e845af8beb15b16d).
Consider reading the commit log in order to review this work.
The DB crate's macro and API was changed to fix flakiness observed in
the MultiWorkspace tests when run locally. This flakiness was caused by
a shared `static LazyLock`, that caused concurrent test runs to interact
with the same underlying in-memory database. This flakiness wasn't
possible on CI due to it's usage of `cargo nextest`, whose
process-per-test approach masked this problem.
Essentially, I've changed the `static_connection` macro to remove the
static database variable and redone the internal model. Now, all
database types are thin wrappers around a generic `AppDatabase`. The
`AppDatabase` collects all of the individual table's migrations via the
`inventory` crate, and so only runs the migrations once on startup,
rather than a dozen times on startup.
The new API requires a `cx` so that we can replace the database returned
at runtime, rather than relying exclusively on a process-global
thread-local. However, we are still using a `static LazyLock` so that we
only need to take an `&App`, instead of an `&mut App`. These databases
types are `Clone + Send + Sync`, so you can easily capture-and-move the
database into background tasks and other places that don't have a `cx`.
For tests that require database isolation, it is now possible to set
their own database in init. See
[`workspace::init_test`](https://github.com/zed-industries/zed/pull/51809/changes#diff-041673bbd1947a35d45945636c0055429dfc8b5985faf93f8a8a960c9ad31e28R13610),
for the flakiness fix.
Best part, this change should be entirely compiler driven, so the Zed
agent was able to make the app-wide refactor easily.
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
---------
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
## Summary
- Implements `icon_label` on `GitPanel` to return the total count of
uncommitted changes (`new_count + changes_count`) when non-zero, capped
at `"99+"` for large repos.
- Updates `PanelButtons::render()` to render that label as a small green
badge overlaid on the panel's sidebar icon, using absolute positioning
within a `div().relative()` wrapper.
- The badge uses `version_control_added` theme color and
`LabelSize::XSmall` text with `LineHeightStyle::UiLabel` for accurate
vertical centering, positioned at the top-right corner of the icon
button.
The `icon_label` method already existed on the `Panel`/`PanelHandle`
traits with a default `None` impl, and was already implemented by
`NotificationPanel` (unread notification count) and `TerminalPanel`
(open terminal count) — but was never rendered. This wires it up for all
three panels at once.
## Notes
- Badge is positioned with non-negative offsets (`top(0)`, `right(0)`)
to stay within the parent container's bounds. The status bar's
`render_left_tools()` uses `.overflow_x_hidden()`, which in GPUI clips
both axes (the `overflow_mask` returns a full content mask whenever any
axis is non-`Visible`), so negative offsets would be clipped.
- `LineHeightStyle::UiLabel` collapses line height to `relative(1.)` so
flex centering aligns the visual glyph rather than a
taller-than-necessary line box.
- No new data tracking logic — `GitPanel` already maintains `new_count`
and `changes_count` reactively.
- No feature flag or settings added per YAGNI.
## Suggested .rules additions
The following pattern came up repeatedly and would prevent future
sessions from hitting the same issue:
```
## GPUI overflow clipping
`overflow_x_hidden()` (and any single-axis overflow setter) clips **both** axes in GPUI.
The `overflow_mask()` implementation in `style.rs` returns a full `ContentMask` (bounding box)
whenever any axis is non-`Visible`. Absolute-positioned children that extend outside the element
bounds will be clipped even if only the X axis is set to Hidden.
Avoid negative `top`/`right`/`bottom`/`left` offsets on absolute children of containers
that have any overflow hidden — keep badge/overlay elements within the parent's bounds instead.
```
Release Notes:
- Added a numeric badge to the git panel sidebar icon showing the count
of uncommitted changes.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Remove the BreadcrumbText struct from workspace and use the existing
HighlightedText struct from the language crate instead. The per-segment
font field is replaced by returning an optional Font alongside the
segments from the breadcrumbs() method, since the font was always
uniform across all segments of a given item.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
This will help with test times (in some cases), as nextest cannot figure
out whether a given rdep is actually an alive edge of the build graph
Closes #ISSUE
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Closes#49800
Adds `handle_drop` to Item & ItemHandle, which allows an active item in
a pane to consume drop events before the pane does.
Release Notes:
- terminal: Fix drag-and-drop not working in vertical terminal panels
Closes#50624
The empty bottom section of the project panel showed a horizontal
scrollbar on hover, but scrolling didn't work there. Added a scroll
wheel handler to the blank area that forwards scroll events to the
uniform list's scroll handle, making both horizontal and vertical
scrolling work from anywhere in the panel.
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zedindustries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- Fixed project panel empty area showing a non-functional scrollbar;
scrolling now works from anywhere in the panel
---------
Co-authored-by: MrSubidubi <finn@zed.dev>
Fixes ZED-596
Release Notes:
- Fixed a panic in editor::GoToDefinitionSplit if you managed to close
the current pane before the definitions were resolved
Replaces a bunch of `impl FnMut` parameters with `&mut dyn FnMut` for
functions where this is the sole generic parameter.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Fixes#28339
## What
- Normalize cwd-relative path-like targets that include leading `..`
before worktree lookup.
- Update issue #28339 tests to expect `WorktreeExact` for local and
remote resolution.
## Why
- Prevent terminal links like `../foo/bar.txt` from creating invalid
entries; resolve to the correct worktree file instead.
## How to test
- `cargo test -p terminal_view issue_28339 -- --nocapture`
- Manual: open a workspace, run `echo ../foo/bar.txt` from a subdir in
the terminal, then cmd/ctrl-click and confirm the correct file opens.
## Risk
- Low: only changes terminal path-like resolution for `..` paths;
expected to match normalized behavior.
## Checklist
- [x] Tests run (`cargo test -p terminal_view issue_28339 --
--nocapture`)
- [x] Docs updated (not needed)
- [x] Backwards compatibility considered
Release Notes:
- Fixed an issue where relative paths starting with `..` would not resolve correctly when clicking the link in the terminal
---------
Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
Replace `FuturesUnordered` with `FuturesOrdered` to maintain terminal
tab ordering when restoring a workspace.
Also clamp `pinned_count` to `items_len()` to prevent panics when fewer
terminals are restored than expected.
The changes:
1. Order preservation: `FuturesUnordered` → `FuturesOrdered` ensures
terminals restore in their original order
2. Bounds fix: `.min(pane.items_len())` prevents setting pinned count
higher than actual items
Closes#44463
Release Notes:
- Preserved terminal order and fixed pinned count on workspace restore
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Release Notes:
- Added agent panel restoration. Now restarting your editor won't cause
your thread to be forgotten.
---------
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>