Skip to content

Check for Jupyter Notebook before allocating other terminal sizes.#103

Merged
wolph merged 2 commits intowolph:developfrom
matthewwardrop:patch-1
Mar 27, 2017
Merged

Check for Jupyter Notebook before allocating other terminal sizes.#103
wolph merged 2 commits intowolph:developfrom
matthewwardrop:patch-1

Conversation

@matthewwardrop
Copy link
Copy Markdown
Contributor

@matthewwardrop matthewwardrop commented Mar 24, 2017

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?

@wolph

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?
@wolph
Copy link
Copy Markdown
Owner

wolph commented Mar 24, 2017

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.

@matthewwardrop
Copy link
Copy Markdown
Contributor Author

matthewwardrop commented Mar 25, 2017

Hmmm... That's odd. When I checked this before, ZMQ is not used for the command line shell.

In [1]: get_ipython()
Out[1]: <IPython.terminal.interactiveshell.TerminalInteractiveShell at 0x10bca3b00>`

Is it different on non-UNIX platforms?

@wolph
Copy link
Copy Markdown
Owner

wolph commented Mar 27, 2017

You're right, my mind was somehow stuck in the past before jupyter detection was fixed properly. This fix works just fine :)

@wolph wolph merged commit 6a59fc6 into wolph:develop Mar 27, 2017
@matthewwardrop
Copy link
Copy Markdown
Contributor Author

matthewwardrop commented Mar 28, 2017

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!

@matthewwardrop matthewwardrop deleted the patch-1 branch March 28, 2017 03:40
@wolph
Copy link
Copy Markdown
Owner

wolph commented Mar 30, 2017

I've pushed out a new release so you can now install progressbar2 3.16.1 :)

@matthewwardrop
Copy link
Copy Markdown
Contributor Author

Thanks!

@matthewwardrop
Copy link
Copy Markdown
Contributor Author

Hi @wolph. This PR seems to have gone missing despite being merged. Can you confirm?

@wolph
Copy link
Copy Markdown
Owner

wolph commented Apr 14, 2017

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

@matthewwardrop
Copy link
Copy Markdown
Contributor Author

Thanks @wolph!

That is very odd indeed :). Anyway... all looks good now! Thanks again.

@matthewwardrop
Copy link
Copy Markdown
Contributor Author

@wolph This patch has gone missing again. 🤒

wolph added a commit that referenced this pull request May 25, 2017
Reaplying @matthewwardrop his pull request #103 v3.20.1
@wolph
Copy link
Copy Markdown
Owner

wolph commented May 25, 2017

How... why :(
The commit is somehow actually disappearing from git every time.

I've manually downloaded the patch and re-applied it using git apply instead of cherry-picking it again

@wolph
Copy link
Copy Markdown
Owner

wolph commented May 25, 2017

It's definitely in v3.20.1 now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants