The auto-scroll in the serial monitor does not scroll to the bottom line of the window.
This issue was reportedly fixed last year, but I'm still experiencing it using 2.0.3. Am I missing something?
1 Like
Hi @blewtobits . There was a regression since then (you can see the link in your screenshot). The new incarnation of the bug is tracked here:
opened 08:25AM - 04 Dec 22 UTC
topic: code
type: imperfection
topic: serial monitor
### Describe the problem
The Arduino IDE "**Serial Monitor**" view has a "**Tโฆ oggle 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 autoscroll is not done completely, resulting in the most recently printed line only being partly visible.
### To reproduce
#### Equipment
- Any Arduino board capable of serial output.
#### Steps
1. Create a sketch that produces sufficient serial output to exceed the height of the "**Serial Monitor**" view:
```cpp
void setup() {
Serial.begin(9600);
delay(10000);
for (byte counter = 0; counter <= 100; counter++) {
Serial.print("hello #");
Serial.println(counter);
}
}
void loop() {}
```
1. Connect the Arduino board to your computer.
1. Select the board and port in Arduino IDE.
1. Open the "**Serial Monitor**" view if it is not already open.
1. Select "**9600 baud**" from the dropdown baud rate menu at the top right corner of the "**Serial Monitor**" view.
1. If it is not already enabled, click the "**Toggle Autoscroll**" icon near the top left corner of the "**Serial Monitor**" view to enable autoscroll.
1. Immediately select the "**Serial Monitor**" tab in the bottom panel.
**โ** The "immediately" instruction, as well as the delay in the sketch, are required to avoid the demo's result being affected by a separate autoscroll-related bug `https://github.com/arduino/arduino-ide/issues/1724`
1. Wait until the sketch program's 10 s delay has passed.
๐ The line shown at the bottom of the "**Serial Monitor**" view is not `hello #100` as expected:

1. Scroll the output field of the "**Serial Monitor**" view downward.
๐ The field was not scrolled all the way to the end of the output even though autoscroll was enabled.
### Expected behavior
The most recently printed line is always shown above the bottom edge of the Serial Monitor view when autoscroll is enabled.
### Arduino IDE version
#### Original report
5695fd8
#### Last verified with
76f9f63
### Operating system
Windows
### Operating system version
10
### Additional context
I bisected the issue to https://github.com/arduino/arduino-ide/commit/ac9cce1 / https://github.com/arduino/arduino-ide/pull/1662 (it does not occur when using the build from https://github.com/arduino/arduino-ide/commit/c0af1e6)
---
This bug also occurred in previous versions of Arduino IDE: https://github.com/arduino/arduino-ide/issues/972, but was fixed by https://github.com/arduino/arduino-ide/pull/1446
#### Additional reports
(from current incarnation of the bug)
- https://forum.arduino.cc/t/arduino-2-0-3-serial-monitor-autoscroll-inoperative/1062358
- https://github.com/arduino/arduino-ide/issues/1602#issuecomment-1368299055
- https://forum.arduino.cc/t/auto-scroll-wont-scroll-all-the-way/1089933
- https://forum.arduino.cc/t/bug-arduino-2-0-0-serial-monitor-scrolling-hides-last-line/1042690/7
(from time of the previous incarnation of the bug: https://github.com/arduino/arduino-ide/issues/972)
- https://github.com/arduino/arduino-ide/issues/1267
- https://github.com/arduino/arduino-ide/issues/1198
- https://github.com/arduino/arduino-ide/issues/812#issuecomment-1196261344
- https://forum.arduino.cc/t/ide-2-0-rc6-serial-monitor-window-clipping-on-bottom-line/984677
- https://forum.arduino.cc/t/serial-monitor-never-shows-the-last-line/1003734
#### Related
- https://github.com/arduino/arduino-ide/issues/1724
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.
You'll be glad to learn that someone submitted a proposed fix for it this week:
arduino:main
โ sfe-SparkFro:#1736
opened 11:45PM - 15 Feb 23 UTC
### Motivation
The serial monitor auto-scroll doesn't go all the way down, as dโฆ iscussed in #1736
### Change description
`componentDidUpdate()` has been added to the serial monitor code, which calls `scrollToBottom()`. This ensures the serial monitor goes to the bottom whenever new messages are received.
### Other information
I have very little experience with React and TypeScript, so this may not be the best solution. But it works on my end, and no one else seemed to be working on this bug.
### Reviewer checklist
* [x] PR addresses a single concern.
* [x] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-ide/pulls) before creating one)
* [x] PR title and description are properly filled.
* [x] Docs have been added / updated (for bug fixes / features)
1 Like
Thank you @ptillisch ! I have a github account but I'm still learning how to find my way around it. I look forward to saving the hours of debugging the reason a routine hasn't executed only to find it has .
KurtE
February 17, 2023, 2:54pm
4
Quick note: I did see an email on this yesterday about a Pull Request:
Fix serial monitor not auto-scrolling to bottom by sfe-SparkFro ยท Pull Request #1889 ยท arduino/arduino-ide (github.com)
I went to the checks tab, and then downloaded the windows zip file artifact and unzipped. And my quick 5 minute test looks like it may have fixed it. At least I was not noticing the problem anymore.
But note: this PR has not yet been approved, so have no idea if/when it might be merged in.
system
Closed
August 16, 2023, 2:54pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.