Skip to content

Commit

Permalink
Do not run simple-term-menu in the PyCharm output console
Browse files Browse the repository at this point in the history
Running simple-term-menu in the PyCharm output console has known issues
(hanging IDE, non-visible menu).
  • Loading branch information
IngoMeyer441 committed Nov 7, 2023
1 parent 8899b96 commit 621954b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions simple_term_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
except ImportError as e:
raise NotImplementedError('"{}" is currently not supported.'.format(platform.system())) from e

if "TERM" not in os.environ:
if "PYCHARM_HOSTED" in os.environ:
raise NotImplementedError(
"simple-term-menu does not work in the PyCharm output console. Use a terminal instead (Alt + F12) or "
'activate "Emulate terminal in output console".'
)
raise NotImplementedError("simple-term-menu can only be used in a terminal emulator")


__author__ = "Ingo Meyer"
__email__ = "i.meyer@fz-juelich.de"
Expand Down

0 comments on commit 621954b

Please sign in to comment.