fix(cli): Improve error message for /copy command (#5244)#5416
fix(cli): Improve error message for /copy command (#5244)#5416vero-code wants to merge 3 commits intogoogle-gemini:mainfrom
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @vero-code, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on enhancing the user experience of the CLI by providing more informative error messages. Specifically, it addresses a common pain point for users attempting to use the /copy command in remote or SSH environments, guiding them towards potential solutions rather than a generic failure message.
Highlights
- Improved Error Messaging: The error message displayed when the
/copycommand fails to copy content to the clipboard has been significantly improved. It now provides a clear hint that the issue might be related to remote environments (like SSH or tmux) and suggests alternative solutions such as using OSC52 or switching to a local terminal.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request improves the error message for the /copy command to be more informative in environments where clipboard access might be restricted. The change is clear and addresses the problem described. My review focuses on a critical issue: the unit tests for this command have not been updated to reflect the new error message, which will cause the test suite to fail. Please address this to maintain code quality and test coverage.
1f76167 to
5cf4476
Compare
5cf4476 to
12eceb4
Compare
|
Hi @vero-code, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
|
Hi @bdmorgan, thanks for the update. Since the issue was resolved, this PR is superseded. I'll close it now. |
TLDR
Improves the error message shown when the
/copycommand fails, to help users understand why copying may not work in remote or SSH environments.Dive Deeper
Previously, the message was too generic ("Failed to copy to the clipboard."). This change adds a clear hint that the issue may be related to the environment (e.g., SSH, tmux), and suggests using OSC52 or switching to a local terminal.
Reviewer Test Plan
gemini-cliin a remote session (e.g., SSH)./copy.Testing Matrix
Linked issues / bugs
Related to #5244