The Serial Monitor is not scrolling to the last new line even though Autoscroll is on. It does not matter how large I make the Serial Monitor window when it is attached to the IDE window at the bottom. I thought this was fixed in previous versions but not in this one.
Are you talking about a version of Avast Antivirus?
I am also perplexed by the version number mentioned, but surely it is safe to assume this is about Arduino IDE.
There was a previous incarnation of the bug which was fixed but then there was later a regression. The Arduino IDE developers are tracking this bug here:
opened 08:25AM - 04 Dec 22 UTC
closed 03:11PM - 07 Mar 23 UTC
conclusion: resolved
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. Select **Sketch > Upload** from the Arduino IDE menus.
1. Wait for the upload to finish successfully.
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://github.com/arduino/arduino-ide/issues/1891
- https://github.com/arduino/arduino-ide/issues/1602#issuecomment-1368299055
- https://forum.arduino.cc/t/arduino-2-0-3-serial-monitor-autoscroll-inoperative/1062358
- 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
- https://forum.arduino.cc/t/arduino-ide-2-0-4-is-now-available/1095650/4
(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
- https://forum.arduino.cc/t/serial-monitor-still-not-showing-last-line/1091388
- https://forum.arduino.cc/t/arduino-ide-2-0-4-is-now-available/1095650/4
- https://forum.arduino.cc/t/serial-monitor-not-scrolling-properly-in-version-23-1-6049-build-23-1-7883-775/1097581
#### 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
You'll be glad to know that a fix has already been prepared:
main
← #1736
opened 07:43AM - 03 Mar 23 UTC
### Motivation
An alternative version of #1889. This PR also fixes #1724.
…
Scroll to the bottom fix:
https://user-images.githubusercontent.com/1405703/222668221-46b68d3b-ce4b-48ea-ba67-35f6d22b8667.mp4
Update widget content and scroll position after the widget shows:
https://user-images.githubusercontent.com/1405703/222668321-274bd881-f707-498f-bf3b-7b77af29b7a4.mp4
### Change description
Scroll to the bottom of the monitor widget after the state update.
### Other information
Closes #1724
Closes #1736
### Reviewer checklist
* [ ] PR addresses a single concern.
* [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-ide/pulls) before creating one)
* [ ] PR title and description are properly filled.
* [ ] Docs have been added / updated (for bug fixes / features)
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject. It will be closed as soon as the bug is fixed. After that the fix will be in the Arduino IDE release as well as in the nightly build of Arduino IDE the following day.
Sorry about the version number mix up. I am using Arduino IDE 2.0.4. Autoscroll is ON.
Just downloaded the 2.0.5-nightly-202330305. It is fixed when the serial monitor window at the bottom of the Arduino IDE is made long but not when it is only 4 lines. 4 lines are printed but it only scrolls down by 2 lines.
Hi @Cosmos46 . You misunderstood my reply. The fix has been prepared, but it hasn't been merged. So it is expected that the bug still occurs when using the nightly build of Arduino IDE. Please check back on the links I shared above later this week. I think the fix should be merged soon.
Thank you ptillisch for clearing that up. I did misunderstand you.
@Cosmos46 It was just a joke because your reference matches an Avast version.
Regards
system
Closed
September 2, 2023, 5:34pm
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.