#Extra line break on copy'ed code blocks

1 messages · Page 1 of 1 (latest)

rapid flicker
#

Steps to reproduce:

  1. Ask a question that causes the AI to use the code block markup
  2. click the "Copy code" button

Expected result:
The clipboard will contain the content of the code block

Actual result:
The clipboard will contain the content of the code block with an extra line break at the end.

Platform: ChatGPT on Chromium Browser

On the image example, clickin the button would be expected to inset the text: sudo systemctl daemon-reload
it actually coppyes: sudo systemctl daemon-reload\n

This is particularly a problem when you ask the AI with help with linux shell as it makes it more likely the shell will automatically execute whatever you paste before you edit (ask me how I know that...)