Skip to content

Add support for pasting multi-line strings in Serial Monitor #2164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
M65649 opened this issue Aug 7, 2023 · 2 comments
Open
3 tasks done

Add support for pasting multi-line strings in Serial Monitor #2164

M65649 opened this issue Aug 7, 2023 · 2 comments
Labels
topic: serial monitor Related to the Serial Monitor type: enhancement Proposed improvement

Comments

@M65649
Copy link

M65649 commented Aug 7, 2023

Describe the problem

When pasting in a multi-line string in the serial monitor, line-feeds or carriage returns will be removed and replaced with space.

To reproduce

I used the following sketch to test:

void setup() {
  Serial.begin(9600);
}

void loop() {
  if (Serial.available()) {
    Serial.print((char)Serial.read());
  }
}

Pasting in the following:

1
2
3

Produces:

1 2 3 in the serial monitor. Can also verify via printing the hex values of the characters that the new lines are not included and replaced with space: 0x31 0x20 0x32 0x20 0x33. When printing the hex values and using e.g. PuTTY, one can see that the input correctly includes carriage returns.

Expected behavior

Expected behavior would be:

1
2
3

Arduino IDE version

2.1.2-nightly-20230807

Operating system

Windows

Operating system version

Window 10 22H2

Additional context

This feature is also not available when using the Arduino IDE 1.x Serial Monitor.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@M65649 M65649 added the type: imperfection Perceived defect in any part of project label Aug 7, 2023
@per1234 per1234 added the topic: serial monitor Related to the Serial Monitor label Aug 8, 2023
@per1234 per1234 changed the title Serial monitor doesn't handle pasting in multi-line strings Add support for pasting multi-line strings in Serial Monitor Aug 17, 2023
@per1234 per1234 added type: enhancement Proposed improvement and removed type: imperfection Perceived defect in any part of project labels Aug 17, 2023
@kittaakos
Copy link
Contributor

<input> cannot have line breaks. <textarea> looks more appropriate, but how to handle Enter. There are too many open questions.

@M65649
Copy link
Author

M65649 commented Aug 21, 2023

What about Enter to send and Shift-Enter to insert a newline?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: serial monitor Related to the Serial Monitor type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

3 participants