Skip to content

[Bug] Text rendering has justified word spacing — unreadable output #92

@randomm

Description

@randomm

Problem

Text output in oclite has two readability issues:

1. Justified Word Spacing

Words are spread across the full terminal width with huge gaps between them, as if text is being justified (like CSS text-align: justify).

2. No Left/Right Margins

Text runs edge-to-edge with no breathing room. Need left and right margins (e.g., 2-4 chars) to make content more readable and visually balanced.

Screenshot

See conversation — the output shows:

  • Session Initialized ✓ line has huge gaps between words
  • Bullet points like - 2 open PR s : db-setup .sql grants fix... are spread out
  • Bold markdown text (**Key Constraints**) has broken spacing
  • Tool output lines have inconsistent spacing
  • No margins — text starts at column 0

Expected

  • Normal left-aligned text with standard single-space word separation
  • Comfortable left/right margins (2-4 characters)

Likely Cause

The wrap.ts or markdown.ts module is applying text justification or incorrect padding when wrapping lines to terminal width.

Key Files

  • packages/opencode/src/cli/lite/wrap.ts — word wrapping with margins
  • packages/opencode/src/cli/lite/markdown.ts — streaming markdown renderer
  • packages/opencode/src/cli/lite/index.ts — output pipeline: write(wrap(pad(md.render(content))))

Acceptance Criteria

  • Normal left-aligned text rendering (no justified spacing)
  • Left margin of 2-4 characters on all output
  • Right margin of 2-4 characters (wrap width reduced accordingly)
  • Proper word boundaries preserved
  • Bold/italic markdown renders without extra gaps
  • Tool output in Live Block also has proper margins
  • Readable output at any terminal width

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions