Terminal flavored code block copy button copies a carriage return

Steps to reproduce

  1. Create a bash flavored code block
/```bash
ls /home
/```
  1. Preview the file

  2. Click Copy on the code block

  3. Paste into a bash terminal

Expected result

Copied command pastes into the terminal but isn’t executed because a carriage return was not copied with it

Actual result

Command executes without having to hit return making it difficult to verify or modify the pasted command before executing it.

Environment

  • Operating system: Windows 10 and Ubuntu 20.04
  • Obsidian version: 0.12.19

Additional information

I’m writing documentation for my linux server and the copy button is very handy except the presence of the carriage return means that any command I need to modify before executing has to be manually copied instead of using the copy button.

Please, open a feature request.