Check for Jupyter Notebook before allocating other terminal sizes.#103
Check for Jupyter Notebook before allocating other terminal sizes.#103wolph merged 2 commits intowolph:developfrom
Conversation
Currently, the number of columns and rows used by `progressbar2` in Jupyter notebooks is inherited from the shell from which it was run... which leads to some pretty weird behaviour. Instead, I think we should check for Jupyter notebooks first. Is there ever a case where this doesn't make sense?
Yes, actually... the ipython commanline shell. Detecting the terminal size is very error prone and I haven't found a good way to detect if we are within a Jupyter notebook which is why the method is only used as fallback. This fix unfortunately "breaks" behavior in ipython which is not ideal either. |
|
Hmmm... That's odd. When I checked this before, ZMQ is not used for the command line shell. Is it different on non-UNIX platforms? |
|
You're right, my mind was somehow stuck in the past before jupyter detection was fixed properly. This fix works just fine :) |
|
No worries! Now I can remove my downstream hacks .... or at least, some of them! May submit some other patches at some point :). Thanks @wolph! |
|
I've pushed out a new release so you can now install progressbar2 3.16.1 :) |
|
Thanks! |
|
Hi @wolph. This PR seems to have gone missing despite being merged. Can you confirm? |
|
I honestly have no clue what happened here... it's not in the develop or master branch and doesn't appear to be in the history either. Since I've merged it using the Github pull request interface I'm pretty sure I didn't muck up anything locally but it's still missing somehow. Very odd... I'll reapply your changes and create a new release |
|
Thanks @wolph! That is very odd indeed :). Anyway... all looks good now! Thanks again. |
|
@wolph This patch has gone missing again. 🤒 |
Reaplying @matthewwardrop his pull request #103 v3.20.1
|
How... why :( I've manually downloaded the patch and re-applied it using git apply instead of cherry-picking it again |
|
It's definitely in v3.20.1 now :) |
Currently, the number of columns and rows used by
progressbar2in Jupyter notebooks is inherited from the shell from which it was run... which leads to some pretty weird behaviour. Instead, I think we should check for Jupyter notebooks first.Is there ever a case where this doesn't make sense?
@wolph