Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollbar covers bottom line of Serial Monitor output #1602

Closed
3 tasks done
per1234 opened this issue Oct 30, 2022 · 6 comments
Closed
3 tasks done

Scrollbar covers bottom line of Serial Monitor output #1602

per1234 opened this issue Oct 30, 2022 · 6 comments
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Oct 30, 2022

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

  1. 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);
    }
  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.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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: serial monitor Related to the Serial Monitor labels Oct 30, 2022
@PaulStoffregen
Copy link

Isn't this issue now resolved?

@per1234
Copy link
Contributor Author

per1234 commented Dec 1, 2022

Thanks @PaulStoffregen. I see it was fixed incidentally by #1662

@per1234 per1234 closed this as completed Dec 1, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Dec 1, 2022
@per1234 per1234 self-assigned this Dec 1, 2022
@FitzkeeLab
Copy link

I am still having this problem in version 2.0.3 (Win 10 x64).

@per1234
Copy link
Contributor Author

per1234 commented Dec 31, 2022

Hi @FitzkeeLab. I just tried following the instructions to reproduce the bug provided in the "To reproduce" section of the first post of this issue and I am not able to reproduce it when using Arduino IDE 2.0.3.

If you follow those exact instructions, does the fault occur for you?

@FitzkeeLab
Copy link

You're correct - when the line is long, and both the horizontal and vertical scrollbars are used, the monitor automatically advances to the last line. However, when the line does not extend off the screen and does not require the horizontal scroll bar, the terminal is always "short" by one line.

In the example below (I also increased the delay to 2s to give me more time to check), line #16 is displayed, but I can scroll down to reveal line #17 if I click into the serial monitor window.

capture

@per1234
Copy link
Contributor Author

per1234 commented Jan 1, 2023

Thanks for checking @FitzkeeLab. We are tracking that bug here: #1736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants