Paste preview indicator "[Pasted ~N lines]" incorrectly included in submitted input #7952

Open
opened 2026-02-16 18:08:46 -05:00 by yindo · 2 comments
Owner

Originally created by @CodingOX on GitHub (Jan 29, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When pasting a large block of text (e.g., 130+ lines) into the terminal input area, OpenCode displays a preview indicator [Pasted ~N lines] to show the number of lines being pasted. However, when pressing Enter to submit the input, this preview indicator is incorrectly included as part of the actual content being sent.

Actual behavior:
The submitted content includes the UI placeholder:

[Pasted ~130 lines] xxxline1
line2
line3
...

Expected behavior:
The submitted content should only contain the actual pasted text without the preview indicator:

xxxline1
line2
line3
...

Root cause:
The [Pasted ~N lines] placeholder appears to be added to the input buffer instead of being rendered purely as a visual overlay in the UI layer. This causes the preview text to be treated as user input.

Impact:

  • Commands or code blocks are prefixed with unexpected text
  • May cause command execution failures or syntax errors
  • Affects all paste operations exceeding the line threshold

Plugins

None

OpenCode version

1.1.42

Steps to reproduce

  1. Copy a text block containing more than ~130 lines (or whatever threshold triggers the preview)
  2. Paste the content into the OpenCode terminal input area
  3. Observe the preview indicator: [Pasted ~130 lines] appears
  4. Press Enter to submit the input
  5. Check the actual content sent - the preview indicator is incorrectly included

Screenshot and/or share link

No response

Operating System

MacOS 15.7.3

Terminal

ITerm2

Originally created by @CodingOX on GitHub (Jan 29, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When pasting a large block of text (e.g., 130+ lines) into the terminal input area, OpenCode displays a preview indicator `[Pasted ~N lines]` to show the number of lines being pasted. However, when pressing Enter to submit the input, this preview indicator is incorrectly included as part of the actual content being sent. **Actual behavior:** The submitted content includes the UI placeholder: ``` [Pasted ~130 lines] xxxline1 line2 line3 ... ``` **Expected behavior:** The submitted content should only contain the actual pasted text without the preview indicator: ``` xxxline1 line2 line3 ... ``` **Root cause:** The `[Pasted ~N lines]` placeholder appears to be added to the input buffer instead of being rendered purely as a visual overlay in the UI layer. This causes the preview text to be treated as user input. **Impact:** - Commands or code blocks are prefixed with unexpected text - May cause command execution failures or syntax errors - Affects all paste operations exceeding the line threshold ### Plugins None ### OpenCode version 1.1.42 ### Steps to reproduce 1. Copy a text block containing more than ~130 lines (or whatever threshold triggers the preview) 2. Paste the content into the OpenCode terminal input area 3. Observe the preview indicator: `[Pasted ~130 lines]` appears 4. Press Enter to submit the input 5. Check the actual content sent - the preview indicator is incorrectly included ### Screenshot and/or share link _No response_ ### Operating System MacOS 15.7.3 ### Terminal ITerm2
yindo added the opentuibug labels 2026-02-16 18:08:46 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 29, 2026):

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

  • #8501: [FEATURE]: Allow to expand the pasted text (e.g. [Pasted ~1 lines]) - Related to the paste preview indicator feature

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 29, 2026): This issue might be a duplicate of existing issues. Please check: - #8501: [FEATURE]: Allow to expand the pasted text (e.g. `[Pasted ~1 lines]`) - Related to the paste preview indicator feature Feel free to ignore if none of these address your specific case.
Author
Owner

@CodingOX commented on GitHub (Jan 29, 2026):

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

Feel free to ignore if none of these address your specific case.

No, they’re not the same issue.

@CodingOX commented on GitHub (Jan 29, 2026): > This issue might be a duplicate of existing issues. Please check: > > * [[FEATURE]: Allow to expand the pasted text (e.g. `[Pasted ~1 lines]`) #8501](https://github.com/anomalyco/opencode/issues/8501): [FEATURE]: Allow to expand the pasted text (e.g. `[Pasted ~1 lines]`) - Related to the paste preview indicator feature > > Feel free to ignore if none of these address your specific case. No, they’re not the same issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7952