9591790
markdown: Add support for `HTML` styling attributes (#42143)
Click to expand commit body
Second take on https://github.com/zed-industries/zed/pull/37765.
This PR adds support for styling elements (**b**, **strong**, **em**,
**i**, **ins**, **del**), but also allow you to show the styling text
inline with the current text.
This is done by appending all the up-following text into one text chunk
and merge the highlights from both of them into the already existing
chunk. If there does not exist a text chunk, we will create one and the
next iteration we will use that one to store all the information on.
**Before**
<img width="483" height="692" alt="Screenshot 2025-11-06 at 22 08 09"
src="https://github.com/user-attachments/assets/6158fd3b-066c-4abe-9f8e-bcafae85392e"
/>
**After**
<img width="868" height="300" alt="Screenshot 2025-11-06 at 22 08 21"
src="https://github.com/user-attachments/assets/4d5a7a33-d31c-4514-91c8-2b2a2ff43e0e"
/>
**Code example**
```html
<p>some text <b>bold text</b></p>
<p>some text <strong>strong text</strong></p>
<p>some text <i>italic text</i></p>
<p>some text <em>emphasized text</em></p>
<p>some text <del>delete text</del></p>
<p>some text <ins>insert text</ins></p>
<p>Some text <strong>strong text</strong> more text <b>bold text</b> more text <i>italic text</i> more text <em>emphasized text</em> more text <del>deleted text</del> more text <ins>inserted text</ins></p>
<p><a href="https://example.com">Link Text</a></p>
<p style="text-decoration: underline;">text styled from style attribute</p>
```
cc @bennetbo
**TODO**
- [x] add tests for styling nested text that should result in one merge
Release Notes:
- Markdown Preview: Added support for `HTML` styling elements
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Remco Smits
and
Bennet Bo Fenner
created
74bf1a1
recent_projects: Do not try to watch `/etc/ssh/ssh_config` on windows (#42200)
160bf91
language_models: Filter out whitespace-only text content parts for OpenAI and OpenAI compatible providers (#40316)
Click to expand commit body
Closes #40097
When multiple files are added sequentially to the agent panel, the
request JSON incorrectly includes "text" elements containing only
spaces. These empty elements cause the Zhipu AI API to return a "text
cannot be empty" error.
The fix filters out any "text" elements that are empty or contain only
whitespaces.
UI state when the error occurs:
<img width="300" alt="Image"
src="https://github.com/user-attachments/assets/c55e5272-3f03-42c0-b412-fa24be2b0043"
/>
Request JSON (causing the error):
```
{
"model": "glm-4.6",
"messages": [
{
"role": "system",
"content": "<<CUT>>"
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "[@1.txt](zed:///agent/file?path=C%3A%5CTemp%5CTest%5C1.txt)"
},
{ "type": "text", "text": " " },
{
"type": "text",
"text": "[@2.txt](zed:///agent/file?path=C%3A%5CTemp%5CTest%5C2.txt)"
},
{ "type": "text", "text": " describe" },
```
Release Notes:
- Fixed an issue when an OpenAI request contained whitespace-only text content
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Maokaman1
and
Bennet Bo Fenner
created
aff4c25
markdown: Restore horizontal scrollbars for codeblocks (#40736)
Click to expand commit body
### Summary
Restore the agent pane’s code-block horizontal scrollbar for easier
scrolling without trackpad and preserve individual scroll state across
multiple code blocks.
### Motivation
Addresses https://github.com/zed-industries/zed/issues/34224, where
agent responses with wide code snippets couldn’t be scrolled
horizontally in the panel. Previously there is no visual effect for
scrollbar to let the user move the code snippet and it was not obviously
to use trackpad or hold down `shift` while scrolling. This PR will
ensure the user being able to only use their mouse to drag the
horizontal scrollbar to show the complete line when the code overflow
the width of code block.
### Changes
- Support auto-hide horizontal scrollbar for rendering code block in
agent panel by adding scrollbar support in markdown.rs
- Add `code_block_scroll_handles` cache in
_crates/markdown/src/markdown.rs_ to give each code block a persistent
`ScrollHandle`.
- Wrap rendered code blocks with custom horizontal scrollbars that match
the vertical scrollbar styling and track hover visibility.
- Retain or clear scroll handles based on whether horizontal overflow is
enabled, preventing leaks when the markdown re-renders.
### How to Test
1. Open the agent panel, request code generation, and ensure wide
snippets show a horizontal scrollbar on hover.
3. Scroll horizontally, navigate away (e.g., change tabs or trigger a
re-render), and confirm the scroll position sticks when returning.
5. Toggle horizontal overflow styling off/on (if applicable) and verify
scrollbars appear or disappear appropriately.
### Screenshots / Demos (if UI change)
https://github.com/user-attachments/assets/e23f94d9-8fe3-42f5-8f77-81b1005a14c8
### Notes for Reviewers
- This is my first time contribution for `zed`, sorry for any code
patten inconsistency. So please let me know if you have any comments and
suggestions to make the code pattern consistent and easy to maintain.
- For now, the horizontal scrollbar is not configurable from the setting
and the style is fixed with the same design as the vertical one. I am
happy to readjust this setting to fit the needs.
- Please let me know if you think any behaviors or designs need to be
changed for the scrollbar.
- All changes live inside _crates/markdown/src/markdown.rs_; no API
surface changes.
Closes #34224
### Release Notes:
- AI: Show horizontal scroll-bars in wide markdown elements
Xipeng Jin
created
146e754
URL-encode the image paths in Markdown so that images with filenames (#41788)
Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/41786
Release Notes:
- markdown preview: Fixed an issue where path urls would not be parsed
correctly when containing URL-encoded characters
<img width="1680" height="1126"
alt="569415cb-b3e8-4ad6-b31c-a1898ec32085"
src="https://github.com/user-attachments/assets/7de8a892-ff01-4e00-a28c-1c5e9206ce3a"
/>
aohanhongzhi
created
278fe91
Skip buffer registration if lsp data should be ignored (#42190)
Click to expand commit body
Release Notes:
- N/A
Kirill Bulatov
created
39fb89e
workspace: Do not panic when the database is corruped (#42186)
Click to expand commit body
Fixes ZED-1NK
Release Notes:
- Fixed zed not starting when the database cannot be loaded
Closes #40576
This PR makes Conda activation configurable and transparent by adding a
`terminal.detect_venv.on.conda_manager` setting (`"auto" | "conda" |
"mamba" | "micromamba"`, default `"auto"`), updating Python environment
activation to honor this preference (or the detected manager executable)
and fall back to `conda` when necessary.
The preference is passed via `ZED_CONDA_MANAGER` from the terminal
settings, and the activation command is built accordingly (with proper
quoting for paths). Changes span
`zed/crates/terminal/src/terminal_settings.rs` (new `CondaManager` and
setting), `zed/crates/project/src/terminals.rs` (inject env var),
`zed/crates/languages/src/python.rs` (activation logic), and
`zed/assets/settings/default.json` (document the setting). Default
behavior remains unchanged for most users while enabling explicit
selection of `mamba` or `micromamba`.
Release Notes:
- Added: terminal.detect_venv.on.conda_manager setting to choose the
Conda manager (auto, conda, mamba, micromamba). Default: auto.
- Changed: Python Conda environment activation now respects the
configured manager, otherwise uses the detected environment manager
executable, and falls back to conda.
- Reliability: Activation commands quote manager paths to handle spaces
across platforms.
- Compatibility: No breaking changes; non-Conda environments are
unaffected; remote terminals are supported.
---------
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Casper van Elteren
,
Lukas Wirth
, and
Lukas Wirth
created
082b80e
gpui: Unify the index_for_x methods (#42162)
Click to expand commit body
Supersedes https://github.com/zed-industries/zed/pull/39910
At some point, these two (`index_for_x` and `closest_index_for_x`)
methods where separated out and some code paths used one, while other
code paths took the other. That said, their behavior is almost
identical:
- `index_for_x` computes the index behind the pixel offset, and returns
`None` if there's an overshoot
- `closest_index_for_x` computes the nearest index to the pixel offset,
taking into account whether the offset is over halfway through or not.
If there's an overshoot, it returns the length of the line.
Given these two behaviors, `closest_index_for_x` seems to be a more
useful API than `index_for_x`, and indeed the display map and other core
editor features use it extensively. So this PR is an experiment in
simply replacing one behavior with the other.
Release Notes:
- Improved the accuracy of mouse selections in Markdown
29cc3d0
gpui: Add to support check state to MenuItem (#39876)
Click to expand commit body
Release Notes:
- N/A
---
https://github.com/user-attachments/assets/d46b77ae-88ba-43da-93ad-3656a7fecaf9
The system menu is only support for macOS, so here just modify the macOS
platform special code.
The Windows, Linux used `ApplicationMenu`, I have already added
`checked` option to Zed's ContextMenu.
Then later when this PR merged, we can improve "View" menu to show check
state to panels (Project Panel, Outline Panel, ...).
Jason Lee
created
760747f
markdown: Add support for `HTML` table captions (#41192)
Click to expand commit body
Thanks to @Angelk90 for pointing out that, we were missing this feature.
So this PR implement the caption feature for HTML tables for the
markdown preview.
**Code example**
```html
<table>
<caption>Revenue by Region</caption>
<tr>
<th rowspan="2">Region</th>
<th colspan="2">Revenue</th>
<th rowspan="2">Growth</th>
</tr>
<tr>
<th>Q2 2024</th>
<th>Q3 2024</th>
</tr>
<tr>
<td>North America</td>
<td>$2.8M</td>
<td>$2.4B</td>
<td>+85,614%</td>
</tr>
<tr>
<td>Europe</td>
<td>$1.2M</td>
<td>$1.9B</td>
<td>+158,233%</td>
</tr>
<tr>
<td>Asia-Pacific</td>
<td>$0.5M</td>
<td>$1.4B</td>
<td>+279,900%</td>
</tr>
</table>
```
**Result**:
<img width="1201" height="774" alt="Screenshot 2025-10-25 at 21 18 01"
src="https://github.com/user-attachments/assets/c2a8c1c2-f861-40df-b5c9-549932818f6e"
/>
Release Notes:
- Markdown preview: Added support for `HTML` table captions
Remco Smits
created
d4ec55b
editor: Correctly handle blocks spanning more than 128 rows (#42172)
Click to expand commit body
Release Notes:
- Fixed block rendering for blocks spanning more than 128 rows
* Fix a panic that happened because we lost the
`ContextRetrievalStarted` debug message, so we didn't assign `t0`.
* Write the edit prediction response log file as a markdown file
containing the text, not a JSON file. We mostly always want the text
content.
Release Notes:
- N/A
Max Brunsfeld
created
e43c436
Create sentry releases in after_release (#42169)
Click to expand commit body
This had been moved to auto-release preview, and was not running for
stable.
Closes #ISSUE
Release Notes:
- N/A
If we are in a remote session with the remote dropped, this path is very
much reachable if the call to this function got queued up in a task.
Fixes ZED-124
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Lukas Wirth
created
00eafe6
git: Make long-running git staging snappy in git panel (#42149)
Click to expand commit body
Previously, staging a large file in the git panel would block the UI
items until that operation finished. This is due to the fact that
staging is a git op that is locked globally by git (per repo) meaning
only one op that is modifying the git index can run at any one time. In
order to make the UI snappy while letting any pending git staging jobs
to finish in the background, we track their progress via `PendingOps`
indexed by git entry path. We have already had a concept of pending
operations however they existed at the UI layer in the `GitPanel`
abstraction. This PR moves and augments `PendingOps` into the model
`Repository` in `git_store` which seems like a more natural place for
tracking running git jobs/operations. Thanks to this, pending ops are
now stored in a `SumTree` indexed by git entry path part of the
`Repository` snapshot, which makes for efficient access from the UI.
Release Notes:
- Improved UI responsiveness when staging/unstaging large files in the
git panel
Jakub Konka
created
5044e6a
zeta2: Make eval example file format more expressive (#42156)
Click to expand commit body
* Allow expressing alternative possible context fetches in `Expected
Context` section
* Allow marking a subset of lines as "required" in `Expected Context`.
We still need to improve how we display the results. I've removed the
context pass/fail pretty printing for now, because it would need to be
rethought to work with the new structure, but for now I think we should
focus on getting basic predictions to run. But this is progress toward a
better structure for eval examples.
Release Notes:
- N/A
---------
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Max Brunsfeld
,
Oleksiy Syvokon
,
Ben Kunkle
, and
Agus Zubiaga
created
784fdca
zeta2: Build edit prediction prompt and process model output in client (#41870)
Click to expand commit body
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Max Brunsfeld
,
Agus Zubiaga
,
Ben Kunkle
, and
Piotr Osiewicz
created
fb87972
settings_ui: Use any open workspace window when opening settings links (#42106)
8cccb5d
Use windows runner for publishing winget package (#42144)
Click to expand commit body
Our new linux runners don't have powershell installed which causes the
`release-winget` job to fail. This simply runs that step on windows
instead.
Release Notes:
- N/A
Julia Ryan
created
2895d31
Fix tab switcher close item using wrong pane (#42138)
Click to expand commit body
Closes #40646
Release Notes:
- Fixed `tab_switcher::CloseSelectedItem` doing nothing on tab in
inactive pane
Co-authored-by: Cole Miller <cole@zed.dev>
Andrew Farkas
and
Cole Miller
created
a112153
Enable image support in remote projects (#39158)
Click to expand commit body
Adds support for opening and displaying images in remote projects. The
server streams image data to the client in chunks, where the client then
reconstructs the image and displays it. This change includes:
- Adding `image` crate as a dependency for remote_server
- Implementing `ImageStore` for remote access
- Creating proto definitions for image-related messages
- Adding handlers for creating images for peers
- Computing image metadata from bytes instead of reading from disk for
remote images
Closes #20430
Closes #39104
Closes #40445
Release Notes:
- Added support for image preview in remote sessions.
- Fixed #39104
<img width="982" height="551" alt="image"
src="https://github.com/user-attachments/assets/575428a3-9144-4c1f-b76f-952019ea14cc"
/>
<img width="978" height="547" alt="image"
src="https://github.com/user-attachments/assets/fb58243a-4856-4e73-bb30-8d5e188b3ac9"
/>
---------
Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
Agents running in extensions need to have a root directory of the
extension's dir for installation and authentication, but *not* for the
conversation itself - otherwise the agent is running things like
terminal commands in the wrong dir.
Release Notes:
- Fixed Agent Server extensions having the current working directory of
the extension rather than the project
Richard Feldman
created
ba136ab
editor: Add action to move between snippet tabstop positions v2 (#42127)
Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/41407
This PR fixes the issues that caused #41407 to be reverted in #42008.
Namely that the action context didn't take into account if a snippet
could move backwards or forwards, and the action shared the same key
mapping as `editor::MoveToPreviousWordStart` and
`editor::MoveToNextWordEnd`.
I changed the default key mapping for the move to snippet tabstop to tab
and shift-tab to match the default behavior of other editors.
Release Notes:
- Editor: Add actions to move between snippet tabstop positions
Anthony Eid
created
2d45c23
remote: Flush to stdin when writing to sftp 2 (#42126)
b78f199
Allow for using config specific `gdb` binaries in gdb adapter (#37193)
Click to expand commit body
I really need this for embedded development in IDF and Zephyr, where the
chip vendors sometimes provide there own specialized version of the
tools, and I need to direct zed to use these.
The current GDB adapter only supports the gdb it find in the normal
search path, and it also seems like we where not able to transfer gdb
specific startup arguments (only `-i=dap` is set) .
In order to fix this I (semi wipe using GPT-4.1) expanded the GDB
adapter with 2 new config options :
* **gdb_path** holds a full path to the gdb executable, for now only
full path or relative to cwd
* **gdb_args** an array holding additional arguments given to gdb on
startup
It seemed to me, like the `env` config did not transferred to gdb, so
this is added to.
I have tested this locally, and it seems to work not only compile :-)
Release Notes:
debugger: Adds gdb_path and gdb_args to gdb debug adapter options
debugger: Fix bug where gdb debug sessions wouldn't inherit the shell
environment from Zed
---------
Co-authored-by: Anthony <anthony@zed.dev>
Bo Lorentsen
and
Anthony
created
a7fac65
gpui: Remove unneeded weak Rc cycle in `WindowsWindowInner` (#42119)
bf8864d
gpui: Remove all (unsound) `ManuallyDrop` usages, panic on device loss (#42114)
Click to expand commit body
Given that when we lose our devices unrecoverably we will panic anyways,
might as well do so eagerly which makes it clearer.
Additionally this PR replaces all uses of `ManuallyDrop` with `Option`,
as otherwise we need to do manual bookkeeping of what is and isn't
initialized when we try to recover devices as we can bail out halfway
while recovering. In other words, the code prior to this was fairly
unsound due to freely using `ManuallyDrop::drop`.
Fixes ZED-1SS
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Lukas Wirth
created
08ee4f7
notify: Bump to rebased 8.2.0 fork (#42113)
Click to expand commit body
Hopefully makes progress towards #38109, #39266
Release Notes:
- N/A
Nia
created
6f6f652
zlog: Add env var to enable line number logging (#41905)
9c8e37a
clangd: Fix switch source header action on windows (#42105)
Click to expand commit body
Fixes https://github.com/zed-industries/zed/issues/40935
Release Notes:
- Fixed clangd's switch source header action not working on windows
Lukas Wirth
created
d54c64f
Refresh outline panel on file renames (#42104)
Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/41877
Release Notes:
- Fixed outline panel not updating file headers on rename
Kirill Bulatov
created
0b53da1
remote: Flush to stdin when writing to sftp (#42103)
Click to expand commit body
https://github.com/zed-industries/zed/issues/42027#issuecomment-3497210172
Release Notes:
- Fixed ssh remoting potentially failing due to not flushing stdin to
sftp
7a37dd9
Do not serialize buffers containing bundled files (#38102)
Click to expand commit body
Fix bundled file persistence by introducing SerializationMode enum
Closes: #38094
What's the issue?
Opening bundled files like Default Key Bindings
(zed://settings/keymap-default.json) was causing SQLite foreign key
constraint errors. The editor was trying to save state for these
read-only assets just like regular files, but since bundled files don't
have database entries, the foreign key constraint would fail.
The fix
Replaced the boolean serialize_dirty_buffers flag with a type-safe
SerializationMode enum:
```rust
pub enum SerializationMode {
Enabled, // Regular files persist across sessions
Disabled, // Bundled files don't persist
}
```
This prevents serialization at the source: workspace_id() returns None
for disabled editors, serialize() bails early, and should_serialize()
returns false. When opening bundled files, we set the mode to Disabled
from the start, so they're treated as transient views that never
interact with the persistence layer.
Changes
- editor.rs: Added SerializationMode enum and updated serialization
methods to respect it
- items.rs: Guarded should_serialize() to prevent disabled editors from
being serialized
- zed.rs: Set SerializationMode::Disabled in open_bundled_file()
Result
Bundled files open cleanly without SQLite errors and don't persist
across workspace reloads (expected behavior). Regular file persistence
remains unaffected.
Release Notes: Fixed SQLite foreign key constraint errors when opening
bundled files like Default Key Bindings.
---------
Co-authored-by: MrSubidubi <finn@zed.dev>
ʟᴜɴᴇx
and
MrSubidubi
created
a716362
agent_ui: Make "add more agents" menu item take to extensions (#42098)
Click to expand commit body
Now that agent servers are a thing, this is the primary and easiest way
to quickly add more agents to Zed, without touching any settings JSON
file. :)
Release Notes:
- N/A
Danilo Leal
created
f080686
agent_ui: Do not show Codex wsl warning on wsl take 2 (#42096)
Follow-up of https://github.com/zed-industries/zed/pull/42035
Scroll position needs to be stored immediately, otherwise editor close
may not register that.
Release Notes:
- N/A
Kirill Bulatov
created
fb46bae
remote: Add missing quotation in `extract_server_binary` (#42085)
Click to expand commit body
Also respect the shell env for various commands again
Should close https://github.com/zed-industries/zed/issues/42027
Release Notes:
- Fixed remote server installation failing on some setups
Lukas Wirth
created
28d7c37
recent_projects: Improve user facing error messages on connection failure (#42083)
Click to expand commit body
cc https://github.com/zed-industries/zed/issues/42004
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Lukas Wirth
created
f6da987
agent_ui: Do not show Codex wsl warning on wsl (#42079)
Click to expand commit body
Release Notes:
- Fixed the codex wsl warning being shown on wsl itself