Closed
Description
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
- 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() {}
- Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
- 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. - Connect the Arduino board to your computer.
- Select the board and port in Arduino IDE.
- Open the "Serial Monitor" view if it is not already open.
- Select "9600 baud" from the dropdown baud rate menu at the top right corner of the "Serial Monitor" view.
- If it is not already enabled, click the "Toggle Autoscroll" icon near the top left corner of the "Serial Monitor" view to enable autoscroll.
- Click the "Clear Output" icon at the top left corner of the "Serial Monitor" view.
- Select Sketch > Upload from the Arduino IDE menus.
- Wait for the upload to finish successfully.
- Select the "Serial Monitor" tab in the bottom panel.
🐛 The printed text is not visible in the "Serial Monitor" view:
- Scroll the output field of the "Serial Monitor" view downward.
You will now see the printed text. - Click the "Clear Output" icon at the top left corner of the "Serial Monitor" view.
- 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() {}
- Select Sketch > Upload from the Arduino IDE menus.
- Wait for the upload to finish successfully.
- 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. - 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
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:
- https://forum.arduino.cc/t/ide-2-0-2-serial-monitor-data-forgets-to-scroll-with-new-data/1060247/1
- https://forum.arduino.cc/t/ide-2-0-2-serial-monitor-data-forgets-to-scroll-with-new-data/1060247/3
- https://forum.arduino.cc/t/ide-2-0-2-serial-monitor-data-forgets-to-scroll-with-new-data/1060247/4
- https://forum.arduino.cc/t/ide-2-0-2-serial-monitor-data-forgets-to-scroll-with-new-data/1060247/6
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