question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interactive window not showing output on long execution, even if "Always Scroll On New Cell" is checked

See original GitHub issue

Environment data

  • VS Code version: 1.62.2
  • Jupyter Extension version (available under the Extensions sidebar): v2021.10.1101450599
  • Python Extension version (available under the Extensions sidebar): v2021.11.1422169775
  • OS (Windows | Mac | Linux distro) and version: Windows 10
  • Python and/or Anaconda version: 3.8.12
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): mini conda 64-bit
  • Jupyter server running: Local

Expected behaviour

While in a .py file and pressing CTRL+ENTER or SHIFT+ENTER to execute the current cell, I expect the interactive window to display the output like a terminal window, always showing the last output lines, without manual intervention, even for long executions.

Actual behaviour

It does not wollow the scrolling like a terminal window. The most recent output lines are missing and we must manually scroll to read recent output.

Moreover, we can only read the last 5 lines when output is long.
Ex.: In one script, I have a cell that process many files (filling the interactive output) and then prompts a menu for the next action, but I can only read the last 5 lines of the menu.

Steps to reproduce:

  1. Check “Always Scroll On New Cell” and “Send Selection To Interactive Window” option in Jupyter settings
  2. Add the following code:
#%%
import time
for n in range(100):
    print(n)
    #time.sleep(1)
  1. Press CTRL+ENTER a few time to fill the interactive window
  2. Uncomment #time.sleep(1) -> time.sleep(1)
  3. Press CTRL+ENTER to simulate a long execution
  4. The interactive window does not show the output. Screenshot: image
  5. If I manually scroll, then I see this: image

Is there a way to avoid seeing only 5 lines below “show more (open the raw output data in a text editor) …” (or disable the “show more” feature altogether)?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
rchiodocommented, Mar 24, 2022

The root cause of this is we have no way to tell when the ‘output’ is done. We scroll after the execution is singled as complete but outputs actually show up async after that.

We likely need to implement this scrolling in the core of VS code.

0reactions
rchiodocommented, Jun 10, 2022

@smojef your issue is a separate one. That’s how the output size limit works. That would be a separate issue on VS code core.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS code: 5-Interactive Window - YouTube
​@pedramjahangiry My GitHub repository: https://github.com/PJalgotrader Topics covered: … Show more. Show more ...
Read more >
ListView - Android Developers
The list will automatically scroll to the bottom when a data set change notification is received and only if the last item is...
Read more >
PyCharm - Run and debug Jupyter notebook code cells
Shift+Enter : Runs the current cell and select the cell below it. When executing one cell at a time, mind code dependencies. If...
Read more >
Python GUI Programming With Tkinter - Real Python
When you pack a widget into a window, Tkinter sizes the window as small as it can be while still fully encompassing the...
Read more >
Formatting code outputs - Jupyter Book
Many libraries support their own HTML output formatting, and this generally carries over to Jupyter Book outputs as well. For example, the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found