arduino-ide icon indicating copy to clipboard operation
arduino-ide copied to clipboard

Serial Monitor autoscroll only makes bottom line partially visible

Open per1234 opened this issue 2 years ago • 9 comments

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 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. Upload a sketch that produces sufficient serial output to exceed the height of the "Serial Monitor" view. For example:
    int counter;
    void setup() {
      Serial.begin(9600);
    }
    void loop() {
      Serial.print("hello #");
      Serial.println(counter++);
      delay(500);
    }
    
  2. Open the "Serial Monitor" view.
  3. Select "9600 baud" from the dropdown baud rate menu at the top right corner of the "Serial Monitor" view.
  4. Select the "Toggle Autoscroll" icon at the right side of the bottom panel toolbar if it is not already.
  5. Wait for the serial output to exceed the visible height of the view.

🐛 The most recently printed line is only partly visible:

image

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.0-rc6

Operating system

Windows

Operating system version

10

Additional context

I bisected the issue to https://github.com/arduino/arduino-ide/commit/aba9db6a6b8b26c768ae6da09fabab58f382a9f1 (it does not occur when using the build from https://github.com/arduino/arduino-ide/commit/e5b34624ac297dd7f9d237342988848818c3b66b)


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-rc6-serial-monitor-window-clipping-on-bottom-line/984677
  • https://forum.arduino.cc/t/serial-monitor-never-shows-the-last-line/1003734

Issue checklist

  • [X] I searched for previous reports in the issue tracker
  • [X] I verified the problem still occurs when using the latest nightly build
  • [X] My report contains all necessary details

per1234 avatar Apr 26 '22 21:04 per1234

Same here, for version rc8 on Windows 10.

mklemarczyk avatar Jun 24 '22 11:06 mklemarczyk

It's very annoying to use the mouse scroll all the time to see last text line showed in Serial Monitor.. Windows 10, RC7.

asier70 avatar Jun 24 '22 11:06 asier70

Was double checking that issue was reported. Still there on daily 0701

KurtE avatar Jul 02 '22 13:07 KurtE

The issue is also present on Linux (Ubuntu 18.04) rc8 AppImage.

romainreignier avatar Jul 07 '22 08:07 romainreignier

I have the same problem and is still there in RC8

Hsubtnarg avatar Jul 13 '22 08:07 Hsubtnarg

I noticed another problem conneted to this issue. Trying to select text using mouse works not as expected. Moving mouse pointer to the top part of text allows to select text in current line. Moving it to middle or lower horizontal position selects text in line below! It looks like text is divided in the same way like it hides on the bottom of Serial monitor window. Probably text displayed in Serial Monitor window is not displayed like classical text in Output window but drawed as graphics. Maybe some calculations of this graphic chars position is done wrong.

asier70 avatar Jul 19 '22 12:07 asier70

Confirm RC9 on Win10 still exhibits this clipping of the newest trailing line in SerMon output area. Also note if 'select to end' with mouse - as the newest line is added it is also selected (as expected) :

.. CORRECTION on the following - it worked this was once, but I cannot see it happen now? However when the added line is selected the autoscroll Does Fully Show the bottom line in the highlighted text.

Defragster avatar Jul 24 '22 20:07 Defragster

Interesting screen display! Serial output was a static print waiting for user input. But the MATH was such that that last line was CLIPPED and then recalculated and redrawn repeatedly.

ADDED INFO> Got a repro and watched it crawl and start: Line was on the border of too long it seems. Add and remove of Horiz scroll bar caused the recalc/redraw. Sketch was Teensy LittleFS Integrity (PSRAM or QSPI) open screen text draw: left half screen of laptop with SerMon window at Max Height.

When it was in this state on Win 10 laptop a 2 finger scroll up/down would go clear and when full bottom would repeat the blurred redraw: SerMonSpaz

Defragster avatar Jul 27 '22 04:07 Defragster

rc9.2 - issue still exists.

asier70 avatar Aug 11 '22 06:08 asier70

This issue appears also on MacOS 12.5.

pturri83 avatar Aug 17 '22 02:08 pturri83

rc9.4 - issue still exists on Windows 10. Changing font sizes and interface scaling does not solve the issue.

alec03128 avatar Sep 11 '22 13:09 alec03128

Issue still present in stable release 2.0.0 (Windows 11)

(In any case, KUDOS to the team for this release!! )

tahunus avatar Sep 15 '22 00:09 tahunus

Issue still present in 2.0 release. Window 10.

And yes, KUDOS for producing the new IDE, its spectacular.

el-samiyel avatar Sep 15 '22 20:09 el-samiyel

Resolved by https://github.com/arduino/arduino-ide/pull/1446

per1234 avatar Sep 27 '22 06:09 per1234

The bad serial monitor scroll bug persists in the latest version I'm using:

Version: 2.0.3 Date: 2022-12-05T09:30:25.331Z CLI Version: 0.29.0 [76251df9]

It's SUPER annoying because the output I need to pay attention to (a response to a query) only occurs on the last line of serial output, & I have to scroll down to see that line (which is otherwise completely hidden) every. single. time.

In fact I wasted several hours when I first encountered this bug because it seemed the query wasn't being responded to. But it was. Just hidden.

The puzzling thing is that this bug has been asserted as fixed for months now. But it isn't fixed. Will it ever be fixed? Can it, in fact, be fixed? Is this Kurt Gödel incompleteness territory? Strange times indeed.

heliophagus avatar Dec 20 '22 20:12 heliophagus