Agent-generated JPG/PNG images not displaying inline in chats

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I posted a feature request and it should be working already but it is not (at least on Windows 11 latest Cursor release:

Steps to Reproduce

see above

Operating System

Windows 10/11

Version Information

Version: 3.12.17 (system setup)
VS Code Extension API: 1.128.0
Commit: 0fb762053c34788bb7760d5673f8a6d4c8589d50
Date: 2026-07-17T02:53:53.006Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Auto

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @stoupoun

Thanks for raising this! I can reproduce the issue on Windows and I’ve flagged this for the team.

Perfect @colin , thank you! Now I just want a proper Cursor CLI implementation for Windows without having to go through WSL… :grinning_face:

Same here on Linux (not just Mac).

The agent generated a PNG with GenerateImage. The file was created correctly under the project `assets/` folder (~1.3 MB). The chat reply only had text — no inline preview.

The agent said it was following the tool instruction not to repeat the image as markdown, because the client is supposed to show generated images automatically. That auto-attach never happened in my session.

Workaround that *did* work: a later message with markdown `![alt](absolute path to the png)` rendered the image in chat.

So: file save works, markdown render works, the automatic inline preview after GenerateImage does not. I also checked settings.json — there is no toggle for this.

Happy to share Cursor version / OS details if useful.

@Octavio_Frangipani this sounds like a different bug. Could you open a fresh bug report with all the details requested?

Facing the same issue.

Shows this way on windows 11

image

In the forum ui:
Popup without horizontal scrollbar

Actual markdown content: ![Popup without horizontal scrollbar](C:\path-to\no-scrollbar.png)

Root cause on Windows (3.22.12), traced in the workbench bundle and confirmed with a local patch. Three things stack up:

  1. The sanitizer strips the src. The markdown sanitize schema (GitHub default from hast-util-sanitize) allows only http/https for src. C:\... and C:/... count as protocol C, and file:///... as file, so the image reaches the chat img component with no src at all. Relative paths have no colon, so they survive, and an image like ![x](img.png) does get past this step.
  2. The local-image check only knows Unix paths. The chat img component already supports local images: it reads the file through resolveLocalImage and shows it as a blob URL. But its path check only accepts paths starting with / or ~. Every Windows path falls through to a plain <img src>, which can’t load local files from the vscode-file://vscode-app origin. That’s why it works on Mac/Linux with absolute paths and never on Windows.
  3. The path isn’t decoded. Markdown URL normalization turns \ into %5C, so even once routed as local, resolveLocalImage gets c:%5CProjects%5C...img.png, which resolveRelativePath can’t resolve.

What fixed it for me (backslash, forward-slash, file:/// and relative paths all render now):

  • Allow single-letter protocols in the sanitize schema’s src list, plus file.
  • Make the local-path check also accept ^[a-zA-Z]:([\\/]|%5C), file:// and relative paths.
  • Decode %5C (and convert host-less file:// URIs to paths) before resolveRelativePath in resolveLocalImage and watchLocalImage.

Following up on @KamilTheDev’s root cause above… there’s a workaround on Windows that doesn’t need a patch. Put a slash in front of the drive letter and use forward slashes:

![alt](/C:/path/to/image.png)

That gets past both checks Kamil found. Because the path starts with a slash, the sanitizer doesn’t read C: as a protocol, and the local-image check sees a path starting with /. Plain C:\..., C:/... and file:///C:/... still show a broken image for me.

Tested today on Cursor 3.27.22 and Windows 11, with a PNG inside an open workspace folder. I haven’t tried other formats or files outside the workspace yet.

If your agents produce images, a user rule telling them to write paths this way works as a stopgap until the real fix lands.

Hope that helps! -David
(Well, actually David’s agent with David nodding and saying “that sounds right and it sure did work!”)