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.

Jupyter ignores dual_line mode; Pycharm must enable "Emulate terminal"

See original GitHub issue

First of all, thanks a lot for alive-progress! I find it cool and very useful. I’ve noticed an issue in environments that require force_tty=True when dual_line=True is enabled, like in Jupyter notebooks or in PyCharm without enabling terminal emulation: the progress bar gets printed as new lines instead of being updated; see screenshot below.

Screenshot_20220824_122824

While it is easy to work around in PyCharm, that is not the case with Jupyter notebooks.

Thanks 😃

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rsalmeicommented, Aug 29, 2022

Hi @alllexx88, thank you.

I’ve already told here, a lot of times actually, that Jupyter does not support ANSI Escape Codes. This means it simply ignores the command to make the cursor go up and refresh the previous line, thus it is impossible to make dual line work on it.

Actually, it even ignores the most basic commands, like the one to clear the current line! I had to print several spaces at the end of the line to work around that and clear the garbage from the last line… The same can be said about Pycharm without terminal emulation. These needed commands are ignored if this option is not enabled, so it doesn’t even make sense to try to run it there like this. I don’t even understand why would Jetbrains require an option to make the terminal actually work, it seems silly to me.

That’s it, I expect it should be pretty clear by now that these fancier modes require a terminal. It simply can’t be done if the environment summarily ignores the needed cursor commands.

0reactions
rsalmeicommented, Aug 29, 2022

Thank you @alllexx88, have a good one too! 👋

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter notebook support | PyCharm Documentation - JetBrains
To enable them, open project settings/preferences ( Ctrl+Alt+S ), go to Languages & Frameworks | Jupyter, and select the Show cell toolbar checkbox....
Read more >
PyCharm - Run and debug Jupyter notebook code cells
When executing one cell at a time, mind code dependencies. If a cell relies on some code in another cell, that cell should...
Read more >
How to emulate terminal output and allow parallel run by ...
I commonly right click a tab and select `Run '
Read more >
Jupyter Notebook not Working in Pycharm
Hello, I'm trying to run Jupyter Notebooks on PyCharm Professional 2020.2.When I open a ipynb file, PyCharm starts a managed Server with...
Read more >
vim emulation broken in jupyter notebook in Pycharm ...
I can enter command mode as follows: enter a cell while Vim Emulator is disabled. Then with cursor in cell, enable Vim Emulator....
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