Skip to content

[Bug] TUI multiline paste reconstruction breaks after wide characters #20986

Closed

Description

@zcarc

Description

When multiline pasted text is summarized in the TUI as [Pasted ~N lines], submitting the prompt can corrupt the final text if there are wide characters such as Korean text before the pasted token.

Plugins

No response

OpenCode version

1.3.13

Steps to reproduce

  1. In an empty prompt, type or paste:
    테스트

  2. Copy the following multiline text and paste it into the prompt:
    2. 테스트 A

    • 테스트 B
    • 테스트 C
    • 테스트 D

    This can be reproduced in two ways:

    • Copying text by dragging inside OpenCode until Copied to clipboard appears
    • Copying the same text from outside OpenCode and pasting it into the prompt
  3. Submit the prompt.

Expected behavior
The full submitted prompt should be:
테스트 2. 테스트 A

  • 테스트 B
  • 테스트 C
  • 테스트 D

Actual behavior
The prompt is reconstructed incorrectly and ends up looking like this:
테스트[Pa2. 테스트 A

  • 테스트 B
  • 테스트 C
  • 테스트 D

Notes
This is not limited to text copied by dragging inside OpenCode. The same issue also happens when the multiline text is copied from an external source and pasted into the prompt.

Screenshot and/or share link

No response

Operating System

Mac OS Sonoma 14.6.1

Terminal

zsh

Activity

  1. added
    bugSomething isn't working
    on Apr 4, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 4, 2026
  3. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. simonklee commented on Jun 1, 2026

    @simonklee
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions