Skip to content

Summarized pasted text is corrupted around wide characters in TUI prompt #29707

Closed

Description

@dauphinYan

Description

Bug Description

When the TUI prompt contains wide characters, such as Chinese text, around a summarized paste placeholder like [Pasted ~N lines], the submitted prompt can be corrupted.

The submitted text may keep a partial [Pas prefix from the placeholder and drop trailing characters after the pasted content.

Expected Behavior

The submitted prompt should contain:

  • The Chinese text before the paste.
  • The full pasted content.
  • The Chinese text after the paste.
  • No leftover placeholder text.

Actual Behavior

The submitted prompt can contain a leftover [Pas prefix before the pasted content and can lose trailing characters after the pasted content.

Example:

[Paspublic:

FDelegateHandle AttackFinishedDelegateHandle;斯顿法国红酒看来

Plugins

none

OpenCode version

1.15.11

Steps to reproduce

  1. Open the TUI prompt.
  2. Type Chinese text before the paste, for example 你好你好.
  3. Paste a multi-line code snippet so it becomes [Pasted ~N lines].
  4. Type Chinese text after the paste, for example 阿斯顿法国红酒看来.
  5. Submit the prompt.
  6. Check the actual message sent to the model.

Screenshot and/or share link

Image image

Operating System

Windows11

Terminal

Windows PowerShell

Activity

  1. github-actions commented on May 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. FurryR commented on Jul 4, 2026

    @FurryR

    @simonklee Still happens on 1.15.10 and later versions. Could you please reconfirm?

  3. FurryR commented on Jul 4, 2026

    @FurryR
    Image
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