gh-copilot icon indicating copy to clipboard operation
gh-copilot copied to clipboard

[BUG]:

Open bidhovbizar opened this issue 3 months ago • 3 comments

What happened?

I ran the following and got this flow of events:

(venv) bbizar@automationvm-59:~$ gh copilot suggest -s "List all the files in folder"

Welcome to GitHub Copilot in the CLI!
version 1.1.1 (2025-06-17)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency

? What kind of command can I help you with?
> gh command

? What would you like the gh command to do?
> List all the files in folder

Suggestion:

  ls -l <folder>

? Select an option
> Execute command

? Are you sure you want to execute the suggested command?
> Yes

It shouldn't have asked 'What would you like the gh command to do" it should have taken the value in " ". More over it finds the right command but doesn't execute it at the end.

Versions

What versions of the relevant software are you running?

(venv) bbizar@automationvm-59:~$ gh version
gh version 2.45.0 (2025-07-18 Ubuntu 2.45.0-1ubuntu0.3)
https://github.com/cli/cli/releases/tag/v2.45.0
(venv) bbizar@automationvm-59:~$ gh copilot version
gh-copilot version 1.1.1 (2025-06-17)
(venv) bbizar@automationvm-59:~$

Relevant terminal output

Image

bidhovbizar avatar Sep 09 '25 09:09 bidhovbizar

Hi @bidhovbizar 👋

The problem is that you are using -s, which is actually for:

-s, --shell-out string   Path to file for outputting command to execute

If you remove -s and run:

gh copilot suggest "List all the files in folder"

Then it should work as desired.

BagToad avatar Sep 09 '25 16:09 BagToad

Image In that case I am getting the error ``` Without using the `ghcs` alias or `-s,--shell-out` flag, the suggested command will be copied to your clipboard for you to paste and execute.

✗ Error: failed to execute command: failed to copy to clipboard: exit status 1

@BagToad 

bidhovbizar avatar Sep 16 '25 15:09 bidhovbizar

@BagToad Hi, Do you have any other suggestions I can try here?

bidhovbizar avatar Sep 22 '25 09:09 bidhovbizar