-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Missing dependency check for wl-copy (wl-clipboard) on Ubuntu/Wayland causes copy action to fail #2511
Description
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
- Ensure you are on a Wayland session on Ubuntu.
- Ensure the
wl-clipboardpackage is not installed. - Run any copilot command, for example:
copilot cli "list all text files" - 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