claude-code - 💡(How to fix) Fix Add option to enable word-wrap in code blocks (desktop app) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45415Fetched 2026-04-09 08:05:57
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Fix Action

Fix / Workaround

Current workaround

The only workaround is for Claude to output text as blockquotes (>) instead of code blocks. This wraps lines but loses the monospace font and background styling that makes structured content scannable.

Code Example

{ "codeBlockWordWrap": true }
RAW_BUFFERClick to expand / collapse

Problem

When Claude outputs file contents or structured text inside fenced code blocks, the desktop app renders them with white-space: pre and a horizontal scrollbar. For non-code content (configs, markdown files, task boards, YAML) this makes reading extremely painful — you have to scroll left and right constantly to read each line.

This is especially bad for:

  • Memory files, task boards, and other structured text Claude frequently outputs
  • Any code block with lines longer than the viewport width
  • Users who prefer narrower windows or have smaller screens

Current workaround

The only workaround is for Claude to output text as blockquotes (>) instead of code blocks. This wraps lines but loses the monospace font and background styling that makes structured content scannable.

Proposed solution

Add a setting in settings.json:

{ "codeBlockWordWrap": true }

When enabled, render code blocks with white-space: pre-wrap; word-wrap: break-word instead of white-space: pre. This is a one-line CSS change on the app side.

Alternatively, a per-block toggle (e.g. a wrap/unwrap button in the code block header) would let users choose on the fly.

extent analysis

TL;DR

Enable word wrapping in code blocks by adding a codeBlockWordWrap setting to settings.json and rendering code blocks with white-space: pre-wrap; word-wrap: break-word.

Guidance

  • To fix the issue, add the following line to settings.json: { "codeBlockWordWrap": true }
  • This change will render code blocks with word wrapping, making it easier to read structured text and code with long lines
  • As an alternative, consider implementing a per-block toggle to allow users to choose between wrapped and unwrapped code blocks
  • Test the fix by viewing code blocks with long lines and verifying that they wrap correctly

Example

{
  "codeBlockWordWrap": true
}

This example shows the required setting in settings.json.

Notes

This solution assumes that the desktop app uses CSS to style code blocks and that the proposed CSS change will not have unintended consequences.

Recommendation

Apply workaround by adding the codeBlockWordWrap setting to settings.json, as this is a simple and effective solution to the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING