[BUG] Empty lines in multi-line code blocks are not filled with the background color

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Jul 30, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment

  • Claude Code for VS Code extension
  • Platform: Linux (x64)

In the chat panel, multi-line code blocks do not render with a single continuous background. Each line's background color only wraps the text itself, and blank lines inside the code block have no background at all. As a result, a code block that contains empty lines looks visually fragmented — it appears as several separate gray strips instead of one solid gray block.

This happens even for plain code blocks with no language annotation (no syntax highlighting involved), so it is not specific to any language or to the syntax highlighter.

File/markdown previews in the same editor render code blocks with a correct, continuous background, so the issue seems specific to the chat panel's webview CSS (the <pre>/<code> background is applied per line rather than to the whole block).

<img width="1034" height="188" alt="Image" src="https://github.com/user-attachments/assets/11203fad-4994-40eb-82e3-ccdacb3be588" />

What Should Happen?

The entire code block (including blank lines) should share one continuous background, so the block reads as a single unified box — the way code blocks render in the file/markdown preview.

Error Messages/Logs

Steps to Reproduce

Ask Claude to output a multi-line code block that contains one or more blank lines, e.g.:
line 1
line 2

line 4 (with an empty line above)
line 5

Claude Model

_No response_

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.220

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗