Pasting text broken in 1.0.10 version #2469

Open
opened 2026-02-16 17:35:46 -05:00 by yindo · 13 comments
Owner

Originally created by @sfpmld on GitHub (Nov 1, 2025).

Originally assigned to: @kommander on GitHub.

Description

Description
Hi opencode contributors.
i was testing one custom /command with argument. But pasting is broken. Nothing shows when pasting and it is not a simple display issue :/

OpenCode version
1.0.10

Steps to reproduce
Simply try to paste any yanked text to the chat

OpenCode version

1.0.10

Steps to reproduce

Try to paste text

Screenshot and/or share link

No response

Operating System

Linux Mint 22.1

Terminal

Alacritty 0.16.0-dev

Originally created by @sfpmld on GitHub (Nov 1, 2025). Originally assigned to: @kommander on GitHub. ### Description Description Hi opencode contributors. i was testing one custom /command with argument. But pasting is broken. Nothing shows when pasting and it is not a simple display issue :/ OpenCode version 1.0.10 Steps to reproduce Simply try to paste any yanked text to the chat ### OpenCode version 1.0.10 ### Steps to reproduce Try to paste text ### Screenshot and/or share link _No response_ ### Operating System Linux Mint 22.1 ### Terminal Alacritty 0.16.0-dev
yindo added the opentuibug labels 2026-02-16 17:35:46 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2025):

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

  • #3532: Describes pasted text showing as "[pasted #2 1+ lines]" instead of proper inline pasting - while not identical to your "nothing shows when pasting" issue, both are clipboard/pasting-related bugs that may have the same underlying cause

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

@github-actions[bot] commented on GitHub (Nov 1, 2025): This issue might be a duplicate of existing issues. Please check: - #3532: Describes pasted text showing as "[pasted #2 1+ lines]" instead of proper inline pasting - while not identical to your "nothing shows when pasting" issue, both are clipboard/pasting-related bugs that may have the same underlying cause Feel free to ignore if none of these address your specific case.
Author
Owner

@sfpmld commented on GitHub (Nov 1, 2025):

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

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

Don't think so, just nothing is pasted 🙁

@sfpmld commented on GitHub (Nov 1, 2025): > This issue might be a duplicate of existing issues. Please check: > > * [Pasted text from a clipboard is shown as "[pasted #2 1+ lines]" instead of inline pasting #3532](https://github.com/sst/opencode/issues/3532): Describes pasted text showing as "[pasted [Roadmap & Existing Issues #2](https://github.com/sst/opencode/issues/2) 1+ lines]" instead of proper inline pasting - while not identical to your "nothing shows when pasting" issue, both are clipboard/pasting-related bugs that may have the same underlying cause > > Feel free to ignore if none of these address your specific case. Don't think so, just nothing is pasted 🙁
Author
Owner

@thdxr commented on GitHub (Nov 2, 2025):

i'm not able to reproduce this at all - you're using the same keybinding you'd use to paste stuff into your shell?

@thdxr commented on GitHub (Nov 2, 2025): i'm not able to reproduce this at all - you're using the same keybinding you'd use to paste stuff into your shell?
Author
Owner

@sfpmld commented on GitHub (Nov 2, 2025):

Yes I do. Just Ctrl+c and Ctrl+v in the chat. Nothing fancy. I noticed that, I have no such problem when downgraded to the last 0.x version before 1.x latest one

@sfpmld commented on GitHub (Nov 2, 2025): Yes I do. Just Ctrl+c and Ctrl+v in the chat. Nothing fancy. I noticed that, I have no such problem when downgraded to the last 0.x version before 1.x latest one
Author
Owner

@sfpmld commented on GitHub (Nov 2, 2025):

Found out that simple Ctrl+c & Ctrl+v was working as it is until version 0.15.31.
Just approach similar goal with Shift + Insert in version 1.0.13

@sfpmld commented on GitHub (Nov 2, 2025): Found out that simple `Ctrl+c` & `Ctrl+v` was working as it is until version `0.15.31`. Just approach similar goal with `Shift + Insert` in version `1.0.13`
Author
Owner

@sfpmld commented on GitHub (Nov 2, 2025):

But this 1.0.13 version don't always make me able to launch any command. For the moment I keep scotched to the 0.15.31 and will observe next new version 🙏🏾

@sfpmld commented on GitHub (Nov 2, 2025): But this `1.0.13` version don't always make me able to launch any command. For the moment I keep scotched to the `0.15.31` and will observe next new version 🙏🏾
Author
Owner

@thdxr commented on GitHub (Nov 4, 2025):

does ctrl+shift+v work?

@thdxr commented on GitHub (Nov 4, 2025): does ctrl+shift+v work?
Author
Owner

@zippeurfou commented on GitHub (Nov 4, 2025):

fyi I had the same issue reported in #3908 . I am on mac os using iterm2.
Happy to help debug.

@zippeurfou commented on GitHub (Nov 4, 2025): fyi I had the same issue reported in #3908 . I am on mac os using iterm2. Happy to help debug.
Author
Owner

@sfpmld commented on GitHub (Nov 4, 2025):

in version 0.15.31: everything is good

Image

in version 1.0.21 : can 't do anything. Strange character print without my intervention after trying a slash command

Image
@sfpmld commented on GitHub (Nov 4, 2025): in version `0.15.31`: everything is good <img width="840" height="1085" alt="Image" src="https://github.com/user-attachments/assets/22be0f72-9288-48b1-9364-c11e7d7b6661" /> in version `1.0.21` : can 't do anything. Strange character print without my intervention after trying a slash command <img width="842" height="1074" alt="Image" src="https://github.com/user-attachments/assets/f7aefa5a-25bb-4156-8751-f37b1c64e320" />
Author
Owner

@sfpmld commented on GitHub (Nov 15, 2025):

Gave it a try since v1.0.55 and now v.1.0.65. I can say it works now for me but with Shift + Insert to paste instead of Ctrl + V for version v0.15.31

@sfpmld commented on GitHub (Nov 15, 2025): Gave it a try since `v1.0.55` and now `v.1.0.65`. I can say it works now for me but with `Shift + Insert` to paste instead of `Ctrl + V` for version `v0.15.31`
Author
Owner

@zl6759 commented on GitHub (Nov 21, 2025):

In PuTTY, Shift + Insert to paste and Ctrl + Insert to copy work for version 1.0.85

@zl6759 commented on GitHub (Nov 21, 2025): In PuTTY, Shift + Insert to paste and Ctrl + Insert to copy work for version 1.0.85
Author
Owner

@ruibeard commented on GitHub (Dec 14, 2025):

I've come across same issue
When the clipboard has some kind of image path, pasting won't work.

// didn't work
- xcrun simctl io booted screenshot /tmp/sim.png && open -a Preview /tmp/sim.png
// worked just fine 
+ xcrun simctl io booted screenshot /tmp/sim.pdf && open -a Preview /tmp/sim.pdf

Commands are just an example

@ruibeard commented on GitHub (Dec 14, 2025): I've come across same issue When the clipboard has some kind of **image** path, pasting won't work. ```diff // didn't work - xcrun simctl io booted screenshot /tmp/sim.png && open -a Preview /tmp/sim.png // worked just fine + xcrun simctl io booted screenshot /tmp/sim.pdf && open -a Preview /tmp/sim.pdf ``` Commands are just an example
Author
Owner

@adtac commented on GitHub (Jan 3, 2026):

possible fix: upgrade your Bun version to >= 1.2.21 (do bun --version)

i could repro this on latest master (586e7347bd48cc58b9e1cdc9dd63a71d5e9adb08) on darwin-arm64 with kitty. upgrading bun fixed this issue for me. see below for details.


i ran into what seems like the same issue: pasting the normal way i paste into my terminal (super+v) was broken.

after some Very Professional Debugging (aka print statements lol), i found the issue to actually be in @opentui, not in opencode. Specifically, it's in this class:

// node_modules/@opentui/core/index-zj0wwh9d.js
class KeyHandler extends EventEmitter {
  // ...elided...
  processPaste(data) {
    try {
      const cleanedData = Bun.stripANSI(data);
      this.emit("paste", new PasteEvent(cleanedData));
    } catch (error) {
      console.error(`[KeyHandler] Error processing paste:`, error);
    }
  }
}

the root cause was in the Bun.stripANSI call. it was throwing an Bun.stripANSI is not a function exception, which was caught by the catch clause. i had to add a throw error to force an exception to be visibly printed (adding --print-logs --log-level DEBUG to opencode startup didn't help).

it turns out Bun.stripANSI was added in v1.2.21, but my local version of bun was v1.2.18. note that i start opencode with bun run --cwd /path/to/opencode/packages/opencode src/index.ts instead of the usual npx/npm route because i have a personal fork of opencode with a few minor cosmetic changes.

i did brew upgrade bun to upgrade my local Bun to v1.3.1 and the issue went away. i can now paste fine.

@adtac commented on GitHub (Jan 3, 2026): possible fix: **upgrade your Bun version to >= 1.2.21** (do `bun --version`) i could repro this on latest master (`586e7347bd48cc58b9e1cdc9dd63a71d5e9adb08`) on `darwin-arm64` with `kitty`. upgrading bun fixed this issue for me. see below for details. --- i ran into what seems like the same issue: pasting the normal way i paste into my terminal (super+v) was broken. after some Very Professional Debugging (aka print statements lol), i found the issue to actually be in `@opentui`, not in opencode. Specifically, it's in this class: ```js // node_modules/@opentui/core/index-zj0wwh9d.js class KeyHandler extends EventEmitter { // ...elided... processPaste(data) { try { const cleanedData = Bun.stripANSI(data); this.emit("paste", new PasteEvent(cleanedData)); } catch (error) { console.error(`[KeyHandler] Error processing paste:`, error); } } } ``` the root cause was in the `Bun.stripANSI` call. it was throwing an `Bun.stripANSI is not a function` exception, which was caught by the `catch` clause. i had to add a `throw error` to force an exception to be visibly printed (adding `--print-logs --log-level DEBUG` to opencode startup didn't help). it turns out `Bun.stripANSI` was added in v1.2.21, but my local version of bun was v1.2.18. note that i start opencode with `bun run --cwd /path/to/opencode/packages/opencode src/index.ts` instead of the usual npx/npm route because i have a personal fork of opencode with a few minor cosmetic changes. i did `brew upgrade bun` to upgrade my local Bun to v1.3.1 and the issue went away. i can now paste fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2469