From 0573a583be6ba2f99a2ad5bcc9c8bd19942ebf4a Mon Sep 17 00:00:00 2001 From: clothespin Date: Mon, 15 Mar 2021 20:49:52 -0700 Subject: [PATCH] Registers pyplot.draw as inputhook for prompt_toolkit --- gamestonk_terminal/menu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamestonk_terminal/menu.py b/gamestonk_terminal/menu.py index 8fb14e0e4a3..d41aabf7244 100644 --- a/gamestonk_terminal/menu.py +++ b/gamestonk_terminal/menu.py @@ -1,11 +1,13 @@ import os +from matplotlib import pyplot + from prompt_toolkit import PromptSession from prompt_toolkit.history import FileHistory history_file = os.path.join(os.path.expanduser("~"), ".gamestonk_terminal.his") try: - session = PromptSession(history=FileHistory(history_file)) + session = PromptSession(history=FileHistory(history_file), inputhook=pyplot.draw()) except Exception as e: # noqa: F841 session = None