Skip to content

Missing dependency check for wl-copy (wl-clipboard) on Ubuntu/Wayland causes copy action to fail #2511

@x88

Description

@x88

Describe the bug

Title

Bug: Missing dependency check for wl-copy (wl-clipboard) on Ubuntu/Wayland causes copy action to fail

Description

When using the GitHub Copilot CLI on Ubuntu 22.04.3 LTS with a Wayland session, attempting to copy the suggested command to the clipboard fails if the wl-clipboard package is not installed.

The CLI attempts to execute wl-copy but does not perform a pre-check to verify if the utility is available in the system. This results in an unhandled execution error instead of a helpful prompt guiding the user to install the missing dependency.

Environment

  • OS: Ubuntu 22.04.3 LTS
  • Windowing System: Wayland
  • Copilot CLI Version: [Пожалуйста, впишите вашу версию, например 0.1.x]
  • Node.js version: [Пожалуйста, впишите вашу версию Node.js]

Actual Behavior

The copy action fails, and the CLI throws an error containing wl-copy eoreg (which is likely a corrupted output of ENOENT — indicating that the executable was not found). The data is not copied to the clipboard.

Suggested Fix

Add a dependency check or a proper try/catch block around the clipboard execution process. If process.env.WAYLAND_DISPLAY is present and wl-copy throws an ENOENT error, catch it and output a human-readable recommendation to run sudo apt install wl-clipboard.

Affected version

v1.0.17

Steps to reproduce the behavior

  1. Ensure you are on a Wayland session on Ubuntu.
  2. Ensure the wl-clipboard package is not installed.
  3. Run any copilot command, for example: copilot cli "list all text files"
  4. When the suggestion appears, select the option to copy the command to the clipboard.

Expected behavior

The CLI should gracefully detect that a clipboard utility (wl-copy for Wayland) is missing. It should catch the error and display a user-friendly message, for example:
"Clipboard utility not found. Please install 'wl-clipboard' to use the copy feature."

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:input-keyboardKeyboard shortcuts, keybindings, copy/paste, clipboard, mouse, and text inputarea:platform-linuxLinux-specific: Wayland, X11, Ubuntu, Fedora, Alpine, ARM, terminal emulators

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions