Skip to content

[BUG] Clipboard copy only works first time after upgrading to v1.1.14 (regression from v1.1.13) #8046

Closed

Description

@aaajiao

Description

After upgrading from v1.1.13 to v1.1.14, clipboard copy only works the first time. Subsequent copy operations fail silently (shows "Copied to clipboard" but nothing is actually copied).

Works in: v1.1.13 ✅
Broken in: v1.1.14 ❌

Environment

  • OS: macOS (running OpenCode in Docker container via OrbStack)
  • Terminal: Ghostty
  • OpenCode version: 1.1.14

Ghostty config

copy-on-select = clipboard
clipboard-read = allow
clipboard-write = allow

Steps to Reproduce

  1. Start OpenCode v1.1.14 in Docker container
  2. Select text and copy (first time) → ✅ Works
  3. Select different text and copy (second time) → ❌ Fails
  4. Subsequent copies continue to fail

Expected Behavior

All copy operations should work consistently, as they did in v1.1.13.

Suspected Cause

This regression may be related to mouse interaction changes introduced in v1.1.14:

Related Issues

Workaround

Downgrade to v1.1.13

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 12, 2026
  2. github-actions commented on Jan 12, 2026

    @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.

  3. aaajiao commented on Jan 12, 2026

    @aaajiao
    Author

    Update: Tested v1.1.15

    New Findings

    After upgrading to v1.1.15, the behavior has changed:

    1. v1.1.15 no longer calls xclip/xsel - It appears to use OSC52 instead
    2. Copy to Mac clipboard works - Content is successfully copied to macOS clipboard
    3. But there's a new issue: Cannot paste immediately within TUI

    Reproduction Steps (v1.1.15)

    Scenario Result
    Copy in TUI → Switch to another app → Paste there ✅ Works
    Copy in another app → Paste in TUI ✅ Works
    Copy in TUI → Switch app → Switch back → Paste in TUI ✅ Works
    Copy in TUI → Immediately paste in TUI (no app switch) ❌ Fails

    Environment

    • macOS + Docker (OrbStack)
    • Ghostty terminal with OSC52 enabled:
      clipboard-read = allow
      clipboard-write = allow
      

    Analysis

    It seems Ghostty (or the TUI) requires a focus change to sync the clipboard after OSC52 write. The clipboard content is there (can paste in other apps), but the same terminal window cannot read it immediately.

    This might be:

    1. A Ghostty issue with OSC52 clipboard sync
    2. Or an OpenCode TUI issue with clipboard state management
  4. aaajiao commented on Jan 12, 2026

    @aaajiao
    Author

    Update: Root cause found - NOT an OpenCode bug

    After deeper investigation, I discovered the actual root cause was in my Docker wrapper (OCD), not OpenCode itself.

    What happened:

    • My wrapper spawns fswatch to monitor IPC files for clipboard bridging
    • Due to a process cleanup bug, 130+ zombie fswatch processes accumulated over time
    • Each zombie was still watching the same IPC files
    • When OpenCode wrote to the clipboard IPC file, multiple fswatch processes triggered simultaneously
    • This caused race conditions that made clipboard operations appear to fail

    The fix:

    • Fixed the process group cleanup in my wrapper
    • Now fswatch processes are properly terminated on exit
    • Clipboard works reliably again

    Conclusion:

    This was not an OpenCode v1.1.14 regression. The timing was coincidental - the zombie processes had accumulated to a critical mass around when I upgraded.

    I apologize for the noise. Feel free to close this issue.


    For reference, the fix: aaajiao/opencode-on-dorker#78

  5. aaajiao commented on Jan 12, 2026

    @aaajiao
    Author

    Closing - root cause was in my wrapper, not OpenCode. See comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions