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

[BUG]: The behavior of `Execute command` contradicts with the documentation.

Open your-diary opened this issue 1 year ago • 1 comments

What happened?

When I execute gh copilot suggest command without --shell-out option and select Execute command, it says:

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.

2024-03-22_19-19-12

I think this implies:

If you use the ghcs alias or if you use -s,--shell-out option or if you use both of them, your clipboard is not updated and the suggested command is directly executed.

However, the actual behavior is

  • The suggested command is not executed.

  • The clipboard is not updated either.

  • The suggested command is written to the file specified by -s option.

Versions

gh version 2.46.0 (2024-03-20)
gh-copilot version 1.0.0 (2024-03-18)

your-diary avatar Mar 22 '24 10:03 your-diary

@your-diary : thank you for opening this issue and apologies for the confusion! 🙇

Please allow me to say this is all a bit complicated. 😅 Truthfully the -s, --shell-out flag probably shouldn't have been mentioned in the message as we didn't intend users to fiddle with it; the idea was to use the aliases like the technical preview to execute commands.

Ideally, I think we need to go back to the drawing board to see how we might avoid relying upon the aliases for executing commands all together, having them be convenient little helpers only.

So in the mean time, I'd say to solely stick to the ghcs alias as we should remove mention of -s, --shell-out in the short term while figuring out how to natively handle command execution.

andyfeller avatar Mar 29 '24 03:03 andyfeller