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

fix detection of PyCharm console as TTY #89

Closed
wants to merge 1 commit into from

Conversation

johan12345
Copy link

When running fastprogress in PyCharm (both as part of a script as well as in the interactive Python console), fastprogress does not output a progress bar:
image
(same behavior as e.g. in #62)

This is because sys.stdout.isatty() returns False within PyCharm, and therefore the check in printing fails: https://github.com/fastai/fastprogress/blob/67d40725e0225de51c0dc43255fd78681c014eb8/fastprogress/fastprogress.py#L214

This PR adds an additional check for the PYCHARM_HOSTED environment variable to find out when fastprogress is run within PyCharm.

An alternative would be to set the "Emulate terminal in output console" option in PyCharm, however this only seems to apply to run configurations, not to the interactive Python console.

This was referenced Jun 5, 2021
@jph00
Copy link
Contributor

jph00 commented May 20, 2022

This is an nbdev project, so edits need to be done directly in the notebooks. I've fixed that in master now.

@jph00 jph00 closed this May 20, 2022
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