Skip to content
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

Replace the serial monitor view with a monaco editor #105

Open
kittaakos opened this issue Jul 28, 2020 · 6 comments
Open

Replace the serial monitor view with a monaco editor #105

kittaakos opened this issue Jul 28, 2020 · 6 comments
Labels
topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: enhancement Proposed improvement

Comments

@kittaakos
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

monaco-editor: https://github.com/Microsoft/monaco-editor

This is exactly the same task we did for the Output view in Theia: eclipse-theia/theia#7570

  • It should improve performance in general as the underlying content is wrapped into a monaco.editor.ITextModel. The logic that handles the UI update would be exactly the same as in VS Code; it's not that bad 😄
  • It should align the look and feel all over the application.
  • We get copy/paste/find/select-all for the Serial Monitor for free.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@kittaakos kittaakos self-assigned this Feb 12, 2021
@rsora rsora transferred this issue from arduino/arduino-pro-ide Mar 1, 2021
@silvanocerza silvanocerza added the type: enhancement Proposed improvement label Mar 1, 2021
@kittaakos
Copy link
Contributor Author

Originally posted by @eclipse1985 here:

I want to perform a copy/paste operation from serial monitor output, but the selection disappear on the mouse up

To Reproduce
Steps to reproduce the behavior:

  1. Print something on the serial monitor
  2. Try to select some text

Expected behavior
Selection does not disappear

Screenshots

@kittaakos kittaakos removed their assignment Jul 18, 2021
@steveboak
Copy link

Workaround for selected text becoming unselected on Arduino IDE 2.0.0-Beta.9, Mac OSX Big Sur, Version 11.4

Ctrl-C copy (Command-C on Mac) works correctly if the reset button on the client board is pressed and held while selecting text and copying to clipboard. Do not disconnect or remove power to the board or the whole serial monitor window will be cleared.

I suspect this is because any serial output from the board causes a redraw of the Serial Monitor window, which in turn clears the selection before it can be copied.

@PaulStoffregen
Copy link

PaulStoffregen commented Feb 6, 2022

Please be careful to consider performance impact. Arduino 1.8 uses a lightweight editor (jTextArea). Even just supporting USB1 speed required a lot of work. When data arrives at sustained USB2 speed, its memory & CPU usage quickly spirals out of control, crashing the whole IDE on Windows and freezing the GUI on Linux. A couple years ago I poured a lot of work into improving the performance. Ultimately the problem is data management algorithms designed to support the arbitrary changes a text editor needs can end up performing very badly when used as a FIFO for high speed data.

@CptHolzschnauz
Copy link

All we need is a timestamp, a pause button, a search field and a way to copy to the clipboard. KISS

kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Nov 25, 2022
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Nov 29, 2022
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Nov 29, 2022
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos
Copy link
Contributor Author

kittaakos commented Nov 29, 2022

Notes (for me) on why there is an undesired empty line in the output. Follow-up of: #391 (comment)

debug.ino:

unsigned long previousMillis;
void setup() {
  Serial.begin(9600);
}
void loop() {
  if (Serial.available() > 0) {
    while (Serial.available() > 0) {
      Serial.write(Serial.read());
      delay(10);
    }
  } else if (millis() - previousMillis >= 1000) {
    previousMillis = millis();
    int r = random(10);
    if (r % 2 == 0) {
      Serial.print("mega");
    }
    Serial.println("bug");
  }
}

Monitor output:

bug
bug
bug
megabug
megabug
megabug
megabug
megabug
bug
bug
megabug
bug
megabug

megabug
bug
bug
bug
bug
megabug
megabug
bug
bug
bug

gRPC log:

2022-11-29T14:53:16.769Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU="
88 |  }

2022-11-29T14:53:16.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K"
88 |  }
2022-11-29T14:53:17.769Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Yg=="
88 |  }

2022-11-29T14:53:17.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg=="
88 |  }
2022-11-29T14:53:18.772Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ=="
88 |  }

2022-11-29T14:53:18.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg=="
88 |  }
2022-11-29T14:53:19.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn"
88 |  }

2022-11-29T14:53:19.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw=="
88 |  }

2022-11-29T14:53:19.780Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo="
88 |  }
2022-11-29T14:53:20.772Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn"
88 |  }
2022-11-29T14:53:20.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw=="
88 |  }
2022-11-29T14:53:20.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo="
88 |  }
2022-11-29T14:53:21.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWU="
88 |  }

2022-11-29T14:53:21.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Z2FidQ=="
88 |  }
2022-11-29T14:53:21.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K"
88 |  }
2022-11-29T14:53:22.770Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bQ=="
88 |  }
2022-11-29T14:53:22.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "ZWdhYg=="
88 |  }
2022-11-29T14:53:22.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg=="
88 |  }
2022-11-29T14:53:23.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVnYQ=="
88 |  }
2022-11-29T14:53:23.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ=="
88 |  }
2022-11-29T14:53:23.781Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg=="
88 |  }
2022-11-29T14:53:24.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVn"
88 |  }
2022-11-29T14:53:24.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo="
88 |  }
2022-11-29T14:53:25.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU="
88 |  }
2022-11-29T14:53:25.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K"
88 |  }
2022-11-29T14:53:26.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bQ=="
88 |  }
2022-11-29T14:53:26.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "ZWdhYg=="
88 |  }
2022-11-29T14:53:26.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg=="
88 |  }
2022-11-29T14:53:27.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Yg=="
88 |  }
2022-11-29T14:53:27.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg=="
88 |  }
2022-11-29T14:53:28.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVnYQ=="
88 |  }
2022-11-29T14:53:28.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ=="
88 |  }
2022-11-29T14:53:28.782Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg=="
88 |  }
2022-11-29T14:53:29.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn"
88 |  }
2022-11-29T14:53:29.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw=="
88 |  }
2022-11-29T14:53:29.781Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo="
88 |  }
2022-11-29T14:53:30.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU="
88 |  }
2022-11-29T14:53:30.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K"
88 |  }
2022-11-29T14:53:31.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU="
88 |  }
2022-11-29T14:53:31.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K"
88 |  }
2022-11-29T14:53:32.772Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Yg=="
88 |  }
2022-11-29T14:53:32.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg=="
88 |  }
2022-11-29T14:53:33.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVn"
88 |  }
2022-11-29T14:53:33.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo="
88 |  }
2022-11-29T14:53:34.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn"
88 |  }
2022-11-29T14:53:34.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw=="
88 |  }
2022-11-29T14:53:34.782Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo="
88 |  }
2022-11-29T14:53:35.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWU="
88 |  }
2022-11-29T14:53:35.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Z2FidQ=="
88 |  }
2022-11-29T14:53:35.782Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K"
88 |  }
2022-11-29T14:53:36.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU="
88 |  }
2022-11-29T14:53:36.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K"
88 |  }
2022-11-29T14:53:37.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ=="
88 |  }
2022-11-29T14:53:37.780Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg=="
88 |  }
2022-11-29T14:53:38.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ=="
88 |  }
2022-11-29T14:53:38.780Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg=="
88 |  }
2022-11-29T14:53:39.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVn"
88 |  }
2022-11-29T14:53:39.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo="
88 |  }
2022-11-29T14:53:40.206Z monitor-service INFO stopped monitor to /dev/cu.usbmodem14301 using serial
2022-11-29T14:53:40.207Z daemon INFO 88 |  ERROR:  EOF
88 |  REQ:  {}

Complete gRPC log + programmatically encoded rx_data value:

2022-11-29T14:53:16.769Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU=" --> "bu"
88 |  }

2022-11-29T14:53:16.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K" --> "g\r\n"
88 |  }
2022-11-29T14:53:17.769Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Yg==" --> "b"
88 |  }

2022-11-29T14:53:17.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg==" --> "ug\r\n"
88 |  }
2022-11-29T14:53:18.772Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ==" --> "bug\r"
88 |  }

2022-11-29T14:53:18.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg==" --> "\n"
88 |  }
2022-11-29T14:53:19.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn" --> "meg"
88 |  }

2022-11-29T14:53:19.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw==" --> "abug"
88 |  }

2022-11-29T14:53:19.780Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo=" --> "\r\n"
88 |  }
2022-11-29T14:53:20.772Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn" --> "meg"
88 |  }
2022-11-29T14:53:20.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw==" --> "abug"
88 |  }
2022-11-29T14:53:20.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo=" --> "\r\n"
88 |  }
2022-11-29T14:53:21.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWU=" --> "me"
88 |  }

2022-11-29T14:53:21.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Z2FidQ==" --> "gabu"
88 |  }
2022-11-29T14:53:21.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K" --> "g\r\n"
88 |  }
2022-11-29T14:53:22.770Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bQ==" --> "m"
88 |  }
2022-11-29T14:53:22.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "ZWdhYg==" --> "egab"
88 |  }
2022-11-29T14:53:22.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg==" --> "ug\r\n"
88 |  }
2022-11-29T14:53:23.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVnYQ==" --> "mega"
88 |  }
2022-11-29T14:53:23.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ==" --> "bug\r"
88 |  }
2022-11-29T14:53:23.781Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg==" --> "\n"
88 |  }
2022-11-29T14:53:24.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVn" --> "bug"
88 |  }
2022-11-29T14:53:24.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo=" --> "\r\n"
88 |  }
2022-11-29T14:53:25.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU=" --> "bu"
88 |  }
2022-11-29T14:53:25.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K" --> "g\r\n"
88 |  }
2022-11-29T14:53:26.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bQ==" --> "m"
88 |  }
2022-11-29T14:53:26.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "ZWdhYg==" --> "egab"
88 |  }
2022-11-29T14:53:26.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg==" --> "ug\r\n"
88 |  }
2022-11-29T14:53:27.771Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Yg==" --> "b"
88 |  }
2022-11-29T14:53:27.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg==" --> "ug\r\n"
88 |  }
2022-11-29T14:53:28.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVnYQ==" --> "mega"
88 |  }
2022-11-29T14:53:28.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ==" --> "bug\r"
88 |  }
2022-11-29T14:53:28.782Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg==" --> "\n"
88 |  }
2022-11-29T14:53:29.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn" --> "meg"
88 |  }
2022-11-29T14:53:29.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw==" --> "abug"
88 |  }
2022-11-29T14:53:29.781Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo=" --> "\r\n"
88 |  }
2022-11-29T14:53:30.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU=" --> "bu"
88 |  }
2022-11-29T14:53:30.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K" --> "g\r\n"
88 |  }
2022-11-29T14:53:31.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU=" --> "bu"
88 |  }
2022-11-29T14:53:31.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K" --> "g\r\n"
88 |  }
2022-11-29T14:53:32.772Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Yg==" --> "b"
88 |  }
2022-11-29T14:53:32.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "dWcNCg==" --> "ug\r\n"
88 |  }
2022-11-29T14:53:33.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVn" --> "bug"
88 |  }
2022-11-29T14:53:33.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo=" --> "\r\n"
88 |  }
2022-11-29T14:53:34.775Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWVn" --> "meg"
88 |  }
2022-11-29T14:53:34.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YWJ1Zw==" --> "abug"
88 |  }
2022-11-29T14:53:34.782Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo=" --> "\r\n"
88 |  }
2022-11-29T14:53:35.774Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "bWU=" --> "me"
88 |  }
2022-11-29T14:53:35.778Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Z2FidQ==" --> "gabu"
88 |  }
2022-11-29T14:53:35.782Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K" --> "g\r\n"
88 |  }
2022-11-29T14:53:36.773Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnU=" --> "bu"
88 |  }
2022-11-29T14:53:36.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Zw0K" --> "g\r\n"
88 |  }
2022-11-29T14:53:37.777Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ==" --> "bug\r"
88 |  }
2022-11-29T14:53:37.780Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg==" --> "\n"
88 |  }
2022-11-29T14:53:38.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVnDQ==" --> "bug\r"
88 |  }
2022-11-29T14:53:38.780Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "Cg==" --> "\n"
88 |  }
2022-11-29T14:53:39.776Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "YnVn" --> "bug"
88 |  }
2022-11-29T14:53:39.779Z daemon INFO 88 |  RESP: {
88 |    "rx_data": "DQo=" --> "\r\n"
88 |  }
2022-11-29T14:53:40.206Z monitor-service INFO stopped monitor to /dev/cu.usbmodem14301 using serial
2022-11-29T14:53:40.207Z daemon INFO 88 |  ERROR:  EOF
88 |  REQ:  {}

kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Dec 2, 2022
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos
Copy link
Contributor Author

Upstream microsoft/vscode#142933

kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Apr 27, 2023
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Jun 16, 2023
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Aug 21, 2023
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Aug 21, 2023
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Aug 21, 2023
Closes arduino#105

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

8 participants