Description
Describe the problem
The Arduino IDE "Serial Monitor" view has a "Toggle Autoscroll" control. When this is enabled, the view automatically scrolls down as the number of lines of data exceed the visible height of the view. The bottom line of the Serial Monitor is the most recent output from the Arduino board, and thus often of the most interest to the user.
When a line in the output contains more characters that will fit in the horizontal area of the Serial Monitor output field, a scrollbar is added at the bottom of the field to allow the user to view all the output.
🐛 Autoscroll incompletely scrolls the output field when the horizontal scrollbar is present, resulting in the most recently printed line only being partly visible.
To reproduce
Equipment
- Any Arduino board capable of serial output.
Steps
- Upload a sketch that produces serial output that exceeds the height and width of the "Serial Monitor" view.
For example:int counter; void setup() { Serial.begin(9600); } void loop() { Serial.print("hello #"); Serial.print(counter++); Serial.println(" 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"); delay(500); }
- Open the "Serial Monitor" view.
- Select "9600 baud" from the dropdown baud rate menu at the top right corner of the "Serial Monitor" view.
- Select the "Toggle Autoscroll" icon at the right side of the bottom panel toolbar if it is not already.
- Wait for the serial output to exceed the visible height of the view.
🐛 The most recently printed line is only partly visible:
This is especially problematic when the line contains data that is important for the user to see at the time it is printed vs a constant data stream where the previous line serves just as well at the moment as the unreadable one.
Expected behavior
The most recently printed line is always shown above the bottom edge of the Serial Monitor view.
Arduino IDE version
2.0.1
Operating system
Windows
Operating system version
10
Additional context
In previous versions of Arduino IDE, the issue occurred even when the scrollbar was not present (#972). That bug was fixed by #1446, but this variant specific to the presence of the scrollbar was not resolved by that.
The line does become fully visible if I manually scroll the Serial Monitor down.
Originally reported at https://forum.arduino.cc/t/ide-2-0-1-serial-monitor-line-at-bottom-partially-obscured-when-line-is-long/1047716
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