docs
docs copied to clipboard
The copy button copies the whole link, which is incompatible with shell commands that have a preceding $
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's 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

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
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.
@jo-tree Thank you for opening an issue and linking it to your PR! ✨
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.