Skip to content

Serial Monitor does not Autoscroll on new content received when view is not in focus #1724

Closed
@Defragster

Description

@Defragster

Describe the problem

Serial Monitor view does not autoscroll on new content received when the view is not in focus.

To reproduce

Equipment

Any Arduino board that can print to Serial Monitor.

Steps

  1. Create a sketch that prints to Serial Monitor soon after the program starts:
    void setup() {
      Serial.begin(9600);
      for (byte counter = 0; counter < 100; counter++) {
        Serial.println("hello");
      }
    }
    void loop() {}
  2. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  3. Select the "Toggle Output View" command from the menu.
    This step is only required if the "Output" view was not already open. That condition will be met as a matter of course during normal usage of Arduino IDE so the bug is not specific to the use of the "Toggle Output View" command.
  4. Connect the Arduino board to your computer.
  5. Select the board and port in Arduino IDE.
  6. Open the "Serial Monitor" view if it is not already open.
  7. Select "9600 baud" from the dropdown baud rate menu at the top right corner of the "Serial Monitor" view.
  8. If it is not already enabled, click the "Toggle Autoscroll" icon near the top left corner of the "Serial Monitor" view to enable autoscroll.
  9. Click the "Clear Output" icon at the top left corner of the "Serial Monitor" view.
  10. Select Sketch > Upload from the Arduino IDE menus.
  11. Wait for the upload to finish successfully.
  12. Select the "Serial Monitor" tab in the bottom panel.
    🐛 The printed text is not visible in the "Serial Monitor" view:
    image
  13. Scroll the output field of the "Serial Monitor" view downward.
    You will now see the printed text.
  14. Click the "Clear Output" icon at the top left corner of the "Serial Monitor" view.
  15. Create a sketch that prints to Serial Monitor after a delay:
    void setup() {
      Serial.begin(9600);
      delay(10000);
      for (byte counter = 0; counter < 100; counter++) {
        Serial.println("world");
      }
    }
    void loop() {}
  16. Select Sketch > Upload from the Arduino IDE menus.
  17. Wait for the upload to finish successfully.
  18. Immediately select the "Serial Monitor" tab in the bottom panel.
    The reason for the "immediately" instruction is to ensure the "Serial Monitor" view will have focus by the time the sketch program starts printing.
  19. Wait until the sketch program's 10 s delay has passed.
    🙂 Serial output from the board is visible in the "Serial Monitor" view.
    ❗ The scroll is incomplete due to a separate bug: Serial Monitor scroll is incomplete when autoscroll is enabled #1736

Expected behavior

All buffered output should be visibly displayed in Serial Monitor tab.

Arduino IDE version

Original report

2.0.2

Last verified with

01ee045

Operating system

Windows

Operating system version

windows 11

Additional context

Originally reported at https://forum.pjrc.com/threads/71588-Arduino-IDE2-Serial-Monitor-sometimes-does-not-work-continue-from-Upload-Thread?p=316565

Additional reports:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions