Skip to content

[BUG] Text overflowing on both sides - Opencode, Windows terminal #37

@honzakalnik

Description

@honzakalnik

Bug Description (generated by ChatGPT but checked and edited by me)

When running OpenCode through Termly on Windows 11, the terminal UI renders incorrectly. Text becomes corrupted with leftover characters on both sides of the screen, lines are partially overwritten, and content appears misaligned. This does not occur when running OpenCode directly in a native terminal.

To Reproduce

Steps to reproduce the behavior:

  1. Run termly start --ai opencode
  2. Connect via scanning the QR code
  3. Submit a prompt on PC that generates multi-paragraph output (e.g., long text)
  4. Observe terminal rendering during and after output
  5. If you scroll up or resize the terminal window, the characters overflow on the left and rightside of the screen and stay there

Expected Behavior

  • Text should wrap correctly within the terminal width
  • Lines should be fully redrawn without leftover characters
  • No artifacts should remain on the left or right margin
  • Output should match rendering in a native terminal (Windows Terminal, PowerShell)

Actual Behavior

  • Both sides of the screen accumulates stray characters
  • Lines are partially overwritten instead of properly cleared and redrawn
  • Text appears shifted or broken across lines
  • UI elements become misaligned
  • Output differs significantly from native terminal rendering

Environment

  • OS: Windows 11
  • Node.js version: v24.14.1
  • Termly CLI version: 1.9.0
  • Phone: iPhone 13 mini (latest iOS)
  • AI tool: OpenCode
  • Environment: Local

Screenshots

  • Native terminal (correct rendering)
Image
  • Termly (incorrect rendering with left-side artifacts and broken layout)
Image

Additional Context

  • The issue does NOT occur when running OpenCode directly in:

    • Windows Terminal
    • PowerShell / CMD
  • The issue ONLY occurs when running through Termly

  • The rendering artifacts strongly suggest incorrect handling of:

    • carriage return (\r)
    • erase line (CSI K)
    • cursor positioning
    • or alternate screen buffer updates
  • This is reproducible consistently with long or streaming output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions