Skip to content

[FEATURE]: fix copy/paste problem of opencode cli in linux terminals forever!!! #35978

Description

@Debianreiser

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Copy/paste in opencode TUI on Linux requires manual installation of xclip, xsel, or wl-clipboard. New users hit a dead end — opencode says "Copied to clipboard" but nothing is actually copied. They have to google the issue, find the docs, and apt-install dependencies. This is a poor out-of-box experience.

Solution: Ship precompiled static binaries of xclip, xsel, and wl-clipboard inside opencode's npm package. On first launch, opencode detects the environment (X11/Wayland) and symlinks or spawns the appropriate binary automatically — zero user action needed.

Benefits:

  1. Zero-config UX — opencode just works from npx opencode, no matter the distro. Huge for beginners and CI/headless environments.
  2. Cross-distro compatibility — no dependency on apt/yum/pacman. Works on Alpine, NixOS, immutable distros, containers, etc.
  3. Deterministic behavior — no version mismatches or missing libX11 on minimal systems. Static binaries eliminate "works on my machine".
  4. CI/Devcontainer friendly — no Dockerfile RUN apt-get install steps. Just npx opencode and go.
  5. Windows/macOS parity — those platforms already work out of the box. This closes the gap for Linux users.

Implementation sketch:

  • Add a postinstall/build step that downloads prebuilt static binaries from a trusted source (e.g., GitHub releases of xclip/xsel) for the target platform.
  • Bundle them under node_modules/opencode/bin/.
  • In clipboard.ts, try the bundled binary first, then fall back to system PATH.

This is a common pattern — tools like puppeteer bundle Chromium, esbuild bundles its native binary, and vscode bundles its own clipboard helpers.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions