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

Serial Monitor scroll is incomplete when autoscroll is enabled #1736

Closed
3 tasks done
per1234 opened this issue Dec 4, 2022 · 15 comments · Fixed by #1928
Closed
3 tasks done

Serial Monitor scroll is incomplete when autoscroll is enabled #1736

per1234 opened this issue Dec 4, 2022 · 15 comments · Fixed by #1928
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 Dec 4, 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 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:
    void setup() {
      Serial.begin(9600);
      delay(10000);
      for (byte counter = 0; counter <= 100; counter++) {
        Serial.print("hello #");
        Serial.println(counter);
      }
    }
    void loop() {}
  2. Connect the Arduino board to your computer.
  3. Select the board and port in Arduino IDE.
  4. Open the "Serial Monitor" view if it is not already open.
  5. Select "9600 baud" from the dropdown baud rate menu at the top right corner of the "Serial Monitor" view.
  6. If it is not already enabled, click the "Toggle Autoscroll" icon near the top left corner of the "Serial Monitor" view to enable autoscroll.
  7. Select Sketch > Upload from the Arduino IDE menus.
  8. Wait for the upload to finish successfully.
  9. 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
  10. 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:
    image
  11. 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 ac9cce1 / #1662 (it does not occur when using the build from c0af1e6)


This bug also occurred in previous versions of Arduino IDE: #972, but was fixed by #1446

Additional reports

(from current incarnation of the bug)

(from time of the previous incarnation of the bug: #972)

Related

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 labels Dec 4, 2022
@sfe-SparkFro
Copy link

Adding my own observations in case it's helpful.

Testing with 2.0.4-nightly-20221220, this issue persists. It appears to be that the latest chunk of data is not auto-scrolled, rather than just the last line. Here's some minimal code that demonstrates this behavior:

void setup() 
{
  Serial.begin(115200);
  
  Serial.println("Line 0");
 
  delay(100);
 
  Serial.println("Line 1");
  Serial.println("Line 2");
  Serial.println("Line 3");
  Serial.println("Line 4");
  Serial.println("Line 5");
}

void loop() {}

Testing on an ESP32, after pressing the reset button a couple times, this is always what Serial Monitor shows with auto scroll enabled:

image

Manually scrolling down shows the remaining lines as expected:

image

@KurtE
Copy link

KurtE commented Dec 21, 2022

I am running daily build 1219, did not update today as did not see anything pulled in...

I am also finding my last things added are not being scrolled in to view. In the case I was seeing I maybe added two lines at a time, and nothing showed up, until I used thumb wheel on mouse to scroll it.

Windows 11, Teensy MicroMod Tensy board beta 0.58.3

@per1234 per1234 added the topic: serial monitor Related to the Serial Monitor label Jan 1, 2023
@fhb
Copy link

fhb commented Jan 7, 2023

This bug made me believe there was something wrong with my dual rotary encoder or the Encoder library, spend half a day trying to fix the issue until I realised the buggy autoscroll is at fault! Well I learned a lot during this bug hunt.

Mac Os Big Sur 11.7.2 (20G1020), Arduino IDE Version: 2.0.3, Date: 2022-12-05T09:29:06.685Z (4 weeks ago)

@MK-Guy-I
Copy link

I face after have installed 2.0.3 (CLI Version 029.0 [76251df9]).

It was helpful to debug my state machine which drives my Lego train.

It's missing and does't help, now.

@DanEfran
Copy link

I also wasted some time debugging a nonexistent problem due to this autoscroll bug. Further, it makes the kind of continuous control monitoring I was expecting to do almost impossible. This is a pretty serious problem in my opinion, and I hope it gets fixed soon.

@logowe
Copy link

logowe commented Jan 24, 2023

After getting used to scroll down all the time here I catched myself doing this in every other App - which lead to sometimes 'special' suprising results there ...
However suppose it helps to give away the colleague users of the Arduino IDE just by observing them for this strange behavour 😉

@davidcliddell
Copy link

This really needs to be fixed. It is something everyone uses and the behaviour is difficult to deal with and is different from IDE 1. A CRITICAL bug

@JGoor
Copy link

JGoor commented Feb 15, 2023

Please anyone. This is trivial. Just fix it. This should not be the type of bug that takes this much time to look into. I am considering an alternative IDE which is a pity, to say the least...

@DavidSG2020
Copy link

Yes, it is annoying, and you have to wonder why it hasn't been fixed. Maybe it's a bug buried deep in a 3rd party component the developers are using?

@sfe-SparkFro
Copy link

I've implemented a solution that seems to work and submitted a pull request #1889. For those who can, please give it a try and leave your feedback in the conversation of the pull request rather than here. No need to build from source, beta testing instructions are here. Thanks in advance!

@per1234 per1234 linked a pull request Feb 17, 2023 that will close this issue
4 tasks
@KurtE
Copy link

KurtE commented Feb 17, 2023

FWIW: I downloaded the windows zip file Artifact from the checks tab of the PR and so far, it appears to work.

@gohai
Copy link

gohai commented Feb 28, 2023

This is a critical issue and needs to be addressed. I spent some time today attempting to chase down what looked to be a debouncing-issue on an digital input, when in reality I often was not looking at the most recent line of Serial data received.

I am hoping Arduino could release a fixed version promptly, since a working Serial monitor is so fundamental to this tool.

kittaakos pushed a commit that referenced this issue Mar 3, 2023
Closes #1736

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Mar 7, 2023
@ryaske
Copy link

ryaske commented Mar 10, 2023

I believe that this jumping scrolling behavior is somehow related to the existing bug: https://youtu.be/rAOLCMFk42k

@per1234
Copy link
Contributor Author

per1234 commented Mar 11, 2023

Hi @ryaske. Thanks for your report. Please try it with the latest nightly build of Arduino IDE. If the jumping still occurs when using that version of the IDE then please open a dedicated issue we can use to track the bug.

The nightly build download links are listed here:

https://www.arduino.cc/en/software#nightly-builds

@sfe-SparkFro
Copy link

I can confirm 2.0.4-nightly-20230312 has resolved the incomplete autoscroll issue. The jumping scrolling issue looks to be caused by the horizontal scroll bar popping in and out for whatever reason; I've not seen it myself, but that is a different issue.

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