Skip to content

Pasting text broken in 1.0.10 version #3728

Closed as not planned
Closed as not planned

Description

@sfpmld

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

Activity

  1. github-actions commented on Nov 2, 2025

    @github-actions
    Contributor

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

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

  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 2, 2025
  3. sfpmld commented on Nov 2, 2025

    @sfpmld
    Author

    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 🙁

  4. thdxr commented on Nov 2, 2025

    @thdxr
    Member

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

  5. sfpmld commented on Nov 2, 2025

    @sfpmld
    Author

    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

  6. sfpmld commented on Nov 3, 2025

    @sfpmld
    Author

    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

  7. sfpmld commented on Nov 3, 2025

    @sfpmld
    Author

    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 🙏🏾

  8. thdxr commented on Nov 4, 2025

    @thdxr
    Member

    does ctrl+shift+v work?

  9. self-assigned this
    on Nov 4, 2025
  10. zippeurfou commented on Nov 4, 2025

    @zippeurfou

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

  11. sfpmld commented on Nov 4, 2025

    @sfpmld
    Author

    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
  12. sfpmld commented on Nov 15, 2025

    @sfpmld
    Author

    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

  13. zl6759 commented on Nov 21, 2025

    @zl6759

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

  14. ruibeard commented on Dec 14, 2025

    @ruibeard

    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

  15. adtac commented on Jan 4, 2026

    @adtac

    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.

  16. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  17. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
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