docs icon indicating copy to clipboard operation
docs copied to clipboard

The copy button copies the whole link, which is incompatible with shell commands that have a preceding $

Open jo-tree opened this issue 2 years ago • 2 comments

Code of Conduct

What article on docs.github.com is affected?

I am using Chrome.

https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/deploying-to-google-kubernetes-engine https://docs.github.com/en/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key

Screen Shot 2022-10-27 at 8 20 46 PM This is the copy button that I would like to see ammended

What changes are you suggesting?

The copy button currently copies all of the text in the box. When the text to copy is a command for the shell, especially if it starts with a command that isn't as common as say npm or git there is a preceding $ to indicate it is a shell command. This $ is then copied to the clipboard along with the command, which creates a cumbersome developer experience. I would like to change the {:copy} function to remove any preceding $ that may be present in the string.

Additional information

No response

jo-tree avatar Oct 27 '22 07:10 jo-tree

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

welcome[bot] avatar Oct 27 '22 07:10 welcome[bot]

@jo-tree Thank you for opening an issue and linking it to your PR! ✨

cmwilson21 avatar Oct 27 '22 15:10 cmwilson21

Thanks for opening this issue! As opposed to modifying the copy button, we are working on a solution to remove $ for example shell commands that don't also include output. Because we are working on an internal solution, I am going to close out this issue. However, you or anyone else is welcome to open a PR to remove the $ for this command.

skedwards88 avatar Oct 27 '22 22:10 skedwards88