Skip to content

Clipboard copy fails in web-based VSCode terminals (code-server, GitHub Codespaces) #26459

Description

@xuxusheng

Description

Clipboard copy functionality does not work when running OpenCode in web-based VSCode environments such as:

  • code-server (self-hosted VS Code in browser)
  • GitHub Codespaces
  • VS Code Remote SSH (in some configurations)
  • Gitpod

The UI shows "Copied to clipboard" notification, but nothing is actually copied to the clipboard.

Environment

  • OpenCode version: v1.14.41
  • VS Code environment: code-server / GitHub Codespaces
  • Terminal: VS Code integrated terminal (web-based)
  • OS: Linux (headless server, no X11/Wayland)
  • Browser: Chrome/Firefox/Edge

Steps to Reproduce

  1. Open a web-based VSCode environment (code-server, GitHub Codespaces, etc.)
  2. Install and run OpenCode in the integrated terminal
  3. Start a conversation and get a response
  4. Try to copy text using:
    • Mouse selection (auto-copy on select)
    • OpenCode's built-in copy command (y key)
    • Keyboard shortcuts (Ctrl+C/Cmd+C)
  5. Notification shows "Copied to clipboard"
  6. Try to paste in another application
  7. Result: Nothing is pasted (clipboard is empty)

Expected Behavior

Clipboard copy should work in web-based VSCode environments, allowing users to copy:

  • Code snippets from responses
  • File paths and URLs
  • Any text content from OpenCode

Actual Behavior

  • Copy notification appears ("Copied to clipboard")
  • Nothing is actually copied to clipboard
  • No way to copy content from OpenCode in web-based VSCode

Impact

This issue affects developers who use:

  • code-server: Self-hosted VS Code for remote development
  • GitHub Codespaces: Cloud-based development environments
  • Gitpod: Cloud development platforms
  • VS Code Remote SSH: Remote server development

These environments are increasingly popular for remote development, cloud-based workflows, and development on tablets/mobile devices.

Related Issues

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