[FEATURE] Add a flag that tells Claude Code to emit long lines for prose/markdown content and let the terminal emulator handle word wrapping, rather than inserting hard newline characters at word boundaries
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Problem
Claude Code uses Ink's word wrapping to insert \n characters at word boundaries based on process.stdout.columns. These hard newlines are written into the terminal's scrollback buffer and are indistinguishable from intentional paragraph breaks.
This creates a permanent problem for terminal emulators that support reflow:
Terminal emulators track two types of line endings: soft wraps (line exceeded column width — flagged with WRAPLINE) and hard wraps (explicit \n from the application)
On resize, soft wraps are reflowed to the new width automatically. Hard wraps are preserved as intentional
Because Claude Code inserts \n for word wrapping, all its output is treated as hard-wrapped and can never be reflowed
Real-world impact
In any terminal that allows pane resizing (tmux, Zellij, iTerm2 split panes, Windows Terminal panes, and custom Tauri-based terminals):
User opens a Claude Code session in a narrow pane (45 columns)
Claude Code renders conversation with word wrapping at 45 chars — inserting \n at every word boundary
User resizes the pane to 130 columns
Terminal sends SIGWINCH — Claude Code re-renders its current screen (prompt, status bar) at 130 cols
All scrollback content remains permanently wrapped at 45 characters with vast empty space on the right
The only fix is to restart the session with --resume, which is slow and disruptive
This is especially painful for --resume sessions, where the entire conversation history is rendered at whatever width the terminal happened to be at launch time.
Proposed Solution
Proposed solution
A mode where Claude Code outputs prose as long unwrapped lines, letting the terminal handle visual wrapping:
claude --no-word-wrap
# or
CLAUDE_NO_WRAP=1 claude
Only paragraph word wrapping changes. Structural line breaks (list items, headings, code fences, blank lines) remain as explicit \n.
Why this works
The terminal emulator soft-wraps long lines and flags them with WRAPLINE
On resize, soft-wrapped lines are automatically reflowed to the new width
Cursor positioning, status bars, and structured content still use process.stdout.columns for layout — unaffected
Existing behavior is the default — --no-word-wrap is opt-in
Affected environments
Terminal emulators with reflow: alacritty, kitty, WezTerm, Windows Terminal, iTerm2
Terminal multiplexers: tmux, Zellij
Custom embeddings: Tauri + alacritty_terminal, Electron-based terminals
Alternative Solutions
Alternatives considered
Restart with --resume on resize — Works but takes 1-2s and is disruptive. Currently our only workaround.
Fake large terminal width — Breaks status bar positioning, diff formatting, and all cursor-positioned content.
Heuristic reflow in the terminal emulator — Guess which \n are word-wrap vs intentional. Fragile, breaks on code/structured content.
Post-hoc scrollback rewriting — Scan scrollback, join lines near old column width, re-wrap. Complex, error-prone, destroys ANSI formatting boundaries.
None are satisfactory. The correct fix is for the content producer to distinguish structural newlines from word-wrap newlines, and only emit the former when the terminal can handle wrapping.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Affected environments
Terminal emulators with reflow: alacritty, kitty, WezTerm, Windows Terminal, iTerm2
Terminal multiplexers: tmux, Zellij
Custom embeddings: Tauri + alacritty_terminal, Electron-based terminals
Additional Context
_No response_
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗