Skip to content

Text copied from from Serial Monitor has missing line endings #730

Closed
@per1234

Description

@per1234

Describe the bug

It is sometimes useful to copy the text that was printed by an Arduino board to Serial Monitor. For example, I sometimes copy CSV-style data into a spreadsheet program when I want to do further manipulation and analysis.

🐛 This is currently not possible to do with any multi-line text because the copied content has missing (or perhaps non-standard) line endings.

To Reproduce

  1. Upload a sketch that prints multiple lines of text to serial:
    void setup() {
      Serial.begin(9600);
    }
    void loop() {
      Serial.println("hello");
      delay(1000);
    }
  2. Open the Serial Monitor view in the Arduino IDE (Tools > Serial Monitor).
  3. Select multiple lines of the text that was printed in the Serial Monitor view.
  4. Paste it into a text editor or spreadsheet program.
    🐛 The line endings are not present:
    hellohellohello
    

Expected behavior

Text copied from Serial Monitor has standard line endings.

Arduino IDE version

2.0.0-rc3

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

After copying the following Serial Monitor output:

a
a
a

This command reveals that there are no line endings:

$ xclip -selection clipboard -out | xxd -p

616161

I'm not sure why, but I do get line breaks when I paste the text to the Arduino Forum (Discourse) composer field. In that case, the problem is opposite because I get double spaced text.

But when pasting to VS Code, Notepad++, LibreOffice Calc, GitHub comment field, etc., even a fenced code block on the forum, I get no line breaks.


Related:


Originally reported at:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions