Quency-D / esp-network-monitor

Used to monitor data sent by the esp32 network port.
MIT License
1 stars 1 forks source link

RE: `terminal.sendText` function does not work on Arduino IDE (arduino/arduino-ide#58) #1

Open dankeboy36 opened 11 months ago

dankeboy36 commented 11 months ago

New thread for https://github.com/arduino/arduino-ide/issues/58#issuecomment-1725026196.

@Quency-D, I can confirm this is a bug with the pseudoterminal in Theia. Related module: https://github.com/eclipse-theia/theia/blob/03d0cb83dc72f7a72158d69478494c7e99098e39/packages/plugin-ext/src/plugin/terminal-ext.ts.

The problem must be fixed in Theia IDE first, then picked up by Arduino IDE, then Terminal#sendText can be used as in VS Code. This is unfortunate. I will look into this more and give you a workaround as a PR soon and submit an issue in https://github.com/eclipse-theia/theia/.

As a quick hack, you can use pty#handleInput instead. For example, this works:

      terminal = vscode.window.createTerminal(options);
      terminal.show(true);
      setTimeout(() => {
        pty.handleInput('\x1b[31mHello2 world\x1b[0m');
      }, 1000);
Screen Shot 2023-09-20 at 13 20 29

Good luck with your project!

Quency-D commented 11 months ago

Thank you for your answer and I look forward to your good news.