GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Enhance clipboard error handling by propagating errors and checking command exit codes by ErvisTusha · Pull Request #7220 · anomalyco/opencode

Conversation

@ErvisTusha

@ErvisTusha ErvisTusha commented Jan 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Overview

This pull request improves clipboard functionality by enhancing error handling across all platforms, with particular focus on Linux systems. The changes ensure that clipboard operations properly propagate errors and provide meaningful feedback to users when issues occur.

Changes

1. Clipboard.ts (util/clipboard.ts)

  • Linux Wayland support: Added proper detection for Wayland environments via WAYLAND_DISPLAY environment variable
  • Exit code validation: Added checks for command exit codes (0 means success) for all clipboard tools:
    • wl-copy (Wayland)
    • xclip (X11)
    • xsel (X11)
  • Improved error handling: Tools now throw descriptive errors when clipboard operations fail, instead of silently failing
  • Better error messages: Specific error messages indicate which tool failed and what to install if tools are missing

2. App.tsx (ui/app.tsx)

  • Error propagation: Updated clipboard.copy() calls to properly handle errors
  • User feedback: Added error toast notifications when clipboard operations fail
  • Graceful degradation: Users are informed when copy operation fails instead of silent failure

Technical Details

  • Changed from .catch(() => {}) (silent failures) to .catch((error) => { ... }) (proper error handling)
  • Exit codes are now properly checked for spawned processes
  • Error messages clearly indicate the issue and suggest resolution steps

Testing

  • Tested clipboard copy on Linux with Wayland
  • Tested clipboard copy on Linux with X11
  • Tested clipboard copy on Windows
  • Tested clipboard copy on macOS
  • Verified error messages display correctly when tools are missing

Related Issues

Closes #[issue-number] (if applicable)

Checklist

  • Changes follow the project's contributing guidelines
  • Code is properly formatted
  • Error handling is comprehensive
  • User-facing messages are clear and helpful

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ErvisTusha
fix: Enhance clipboard error handling by propagating errors, checking…
57c927b
… command exit codes, and providing specific messages when tools are missing.
@github-actions

github-actions Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found two related PRs that may be duplicate or closely related to PR #7220:

Potential Related PRs:

  1. PR fix(clipboard): add OSC 52 fallback for SSH/tmux environments #7028 - fix(clipboard): add OSC 52 fallback for SSH/tmux environments

    • fix(clipboard): add OSC 52 fallback for SSH/tmux environments #7028
    • Related because it addresses clipboard functionality improvements, specifically adding fallback mechanisms for different environments
  2. PR fix: enable primary clipboard copy for Wayland/X11 to fix Linux middle-click paste #6370 - fix: enable primary clipboard copy for Wayland/X11 to fix Linux middle-click paste

    • fix: enable primary clipboard copy for Wayland/X11 to fix Linux middle-click paste #6370
    • Related because it directly addresses Wayland/X11 clipboard functionality on Linux, which is a key focus area in PR fix: Enhance clipboard error handling by propagating errors and checking command exit codes #7220

These PRs may have overlapping changes to the clipboard implementation or could be addressing the same underlying issues. I recommend reviewing these PRs to ensure there are no conflicting changes or duplicated efforts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ErvisTusha ErvisTusha mentioned this pull request Jan 7, 2026
Unable to copy terminal output to clipboard on macOS #7134
Closed
@ErvisTusha

ErvisTusha commented Jan 7, 2026

Copy link
Copy Markdown
Author

fixed for 1.1.6 Linux/Ubuntu

Rhiz3K reacted with thumbs up emoji Rhiz3K reacted with eyes emoji
All reactions
  • 👍 1 reaction
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ErvisTusha ErvisTusha closed this Jan 21, 2026
@ErvisTusha
ErvisTusha deleted the fix/clipboard-linux branch January 21, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@ErvisTusha
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.