-
Notifications
You must be signed in to change notification settings - Fork 7
Description
When using the "Copy to clipboard" button on a page for a single-package an extra "\n" (new line) character is appended to that command.
Pasting this command into a command line will automatically execute that command. Maybe this is intended behaviour, but a lot of terminals ask the user to confirm that multiple-lines will be pasted into the command line, so an extra step and some suprise is added.
I am not too familiar with the template language used in fastify, but I guess the new line comes from the carriage return on this line (before {Package.Id}).
Either the generateClipboard function should trim its input or (if the template language supports this) {- Package.Id -}should be used (I am paraphrasing from Twig, where {- means "trim whitespace before this variable").
Example: On https://winget.run/pkg/Audacity/Audacity below "How to install" the copy button next to > winget install -e --id Audacity.Audacity will actually copy winget install -e --id Audacity.Audacity\n