opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Multi-line paste no longer treated as a single block (splits into multiple inputs)

Open ramhaidar opened this issue 3 weeks ago • 1 comments

Description

Description

After upgrading to OpenCodeCLI v1.0.24, pasting a multi-line prompt is no longer accepted as a single input. In prior (pre-v1) versions, the CLI displayed “[pasted # lines]” and processed the entire block atomically. In v1.0.24, the paste fragments—sometimes only the first line runs, sometimes lines execute one by one, and in some cases it spawns multiple sessions.

This looks like a regression or a change in input buffering / bracketed-paste handling. Is there a flag/setting to restore the legacy behavior, or is a new workflow required?

Version

  • OpenCodeCLI: 1.0.24

Expected Behavior

  • Entire multi-line paste is accepted and queued as a single input, with a “[pasted # lines]” confirmation (legacy behavior).

Actual Behavior

  • Paste is fragmented: sometimes only the first line runs; sometimes lines execute one-by-one; in one case it split the block into four separate sessions.

Clipboard Shortcuts (Windows)

  • Ctrl+V: not working (no paste occurs).
  • Ctrl+Shift+V and Shift+Insert: paste works, but the multi-line content is still split rather than treated as one block.

Environment

  • OS: Windows 10 (installed via Scoop)
  • Terminals where reproduced: WezTerm v20240203-110809-5046fc22

Workaround

  • Bundle all instructions into a .txt file and ask the model to read + execute it. This works but is not optimal.

Additional Notes / Questions

  • Was bracketed-paste support removed or gated behind a flag in v1?
  • If this is an intentional change, what is the recommended workflow for large multi-line prompts?
  • If unintentional, can legacy “[pasted # lines]” behavior be restored or made configurable?

OpenCode version

1.0.24

Steps to reproduce

Steps to Reproduce

  1. Launch OpenCodeCLI v1.0.24.
  2. Paste a multi-line prompt/snippet (any text with several lines; example below).
  3. Observe that the paste is not treated as a single block and may execute line-by-line or split into separate sessions.

Example pasted block

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna sem, condimentum sed aliquam a, eleifend id tellus. Proin ligula mauris, pellentesque vel eleifend a, condimentum sed ligula. Donec sollicitudin mauris ac sem euismod consequat. Praesent eu lectus id dolor vulputate semper ut ut ex. Quisque venenatis, urna sit amet molestie fringilla, neque purus aliquam sapien, dictum pellentesque lorem risus rhoncus sem. Vestibulum maximus justo accumsan, feugiat massa eu, fermentum orci. Vivamus sed cursus erat, a euismod enim. Vestibulum condimentum, velit eget rutrum vestibulum, velit leo molestie nulla, sit amet luctus nulla risus sit amet enim. Donec non eros id neque scelerisque lacinia sed sit amet lorem. Morbi blandit, purus at volutpat finibus, purus nulla laoreet ipsum, quis vulputate lectus est eu lacus. Integer maximus odio sem. Cras imperdiet finibus ante dictum tristique. Suspendisse euismod id tortor a suscipit. Nunc urna arcu, tristique at congue in, interdum quis augue. Fusce hendrerit, diam id luctus ullamcorper, tortor ex luctus dolor, id pulvinar nisi libero at felis.

Curabitur sodales vitae justo ut porta. Aenean facilisis egestas quam, in placerat dolor. Vestibulum tempus at orci ut sagittis. Phasellus consequat luctus tellus non venenatis. Curabitur consectetur magna et turpis fringilla suscipit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tempus lorem leo, nec imperdiet velit faucibus sed. Donec egestas lacus ut sem lacinia porttitor. Sed eget felis porttitor, ultrices nulla quis, mattis augue. Duis sit amet lobortis libero, vitae consequat nisl. Nullam mattis enim velit, vitae aliquet ligula efficitur quis. Donec iaculis lacus et egestas laoreet. Pellentesque quis vulputate diam. Nulla interdum, urna nec volutpat varius, libero elit vulputate odio, a rhoncus metus enim id neque.

Vivamus non vehicula eros. Phasellus vitae lectus eu sem vulputate pretium in et enim. Nulla vel mollis sem, non aliquet est. Cras vel sem dui. Sed pharetra molestie cursus. Etiam varius justo vel felis vehicula pulvinar. Morbi vel tortor ut elit semper rutrum. Quisque convallis sit amet eros quis varius. Phasellus imperdiet sed est vel venenatis. Ut laoreet lobortis purus sit amet euismod. Aliquam rhoncus mattis molestie. Curabitur varius mauris vel lacus vehicula, vel scelerisque ipsum porta. Nunc porttitor, nisl non tincidunt hendrerit, felis leo ornare elit, at egestas enim mi sed neque. Duis eu leo lobortis, luctus massa vel, efficitur velit.

Screenshot and/or share link

Image

Operating System

Windows 10 (22H2 19045.4894)

Terminal

WezTerm v20240203-110809-5046fc22

ramhaidar avatar Nov 05 '25 01:11 ramhaidar

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

  • #3343: Cannot paste multiple lines in Windows Terminal and VSCode+Powershell - Similar issue with multi-line paste being split into individual messages on Windows
  • #3542: Paste bug - Same issue described: "on windows its gonna paste and press enter every , damn, line" (closed but might be related)
  • #3397: opentui: Multi-line paste with Ctrl+Shift+V is pasted as single line - Related multi-line paste issue (though different symptom)
  • #3484: Fix TUI paste editor regression - pasted text object not expanding in editor (closed) - Another paste regression issue

The core issue appears to be a regression in bracketed-paste handling specifically affecting Windows users in v1.0.24, where multi-line content is no longer treated as a single atomic input.

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

github-actions[bot] avatar Nov 05 '25 01:11 github-actions[bot]

ok looks like our logic was splitting on newline and seeing if it was > 5 lines - this is too naive because one line can be super long. fixing

thdxr avatar Nov 05 '25 17:11 thdxr

although your example text does work for me

thdxr avatar Nov 05 '25 17:11 thdxr

can you try npx/bunx/whatever opencode-ai@dev and see if it's better?

thdxr avatar Nov 05 '25 17:11 thdxr

@thdxr

can you try npx/bunx/whatever opencode-ai@dev and see if it's better?

Ran it using pnpm dlx opencode-ai@dev, here I include the video recording

PS: Terminal used is WezTerm (wezterm 20240203-110809-5046fc22)

https://github.com/user-attachments/assets/a5351599-308c-4d73-a847-eef29a36b69d

ramhaidar avatar Nov 06 '25 01:11 ramhaidar

can you try npx/bunx/whatever opencode-ai@dev and see if it's better?

I'm using Warp, on MacOS and I used "npx opencode-ai@dev" to test it but I still can't paste multiple lines. I get a something like [Pasted ~1 lines] instead.

thehaseebahmed avatar Nov 06 '25 10:11 thehaseebahmed

can you try npx/bunx/whatever opencode-ai@dev and see if it's better?

I'm using Warp, on MacOS and I used "npx opencode-ai@dev" to test it but I still can't paste multiple lines. I get a something like [Pasted ~1 lines] instead.

Isn't that the correct behavior? If you want to paste raw, maybe use Command + Shift + V or Command + Shift + Option + V ?

ramhaidar avatar Nov 06 '25 11:11 ramhaidar

@thehaseebahmed that's expected behavior it collapses the pastes and expands them again when it is submitted.

If you want to disable this behavior, add the following to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "experimental": {
    "disable_paste_summary": true
  }
}

rekram1-node avatar Nov 06 '25 15:11 rekram1-node

@ramhaidar @rekram1-node Thanks! I just updated today and I think the version I was on before, this behavior was not present. I did try Ctrl + Shift + V but that wasn't working for some reason but this help.

thehaseebahmed avatar Nov 06 '25 15:11 thehaseebahmed