From 2f04ee1598fe6121889b03b011b7c3c355082804 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Wed, 2 Oct 2024 15:27:18 -0700 Subject: [PATCH] Init ipython properly --- drepl-ipython.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drepl-ipython.py b/drepl-ipython.py index ae3015c..1ffd3f0 100644 --- a/drepl-ipython.py +++ b/drepl-ipython.py @@ -12,6 +12,7 @@ from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC from IPython.utils.tokenutil import token_at_cursor +from IPython.terminal.ipapp import launch_new_instance def encoding_workaround(data): if isinstance(data, str): @@ -82,7 +83,6 @@ def __init__(self, *args, **kwargs) -> None: } self.enable_mime_rendering() # TODO: disable history - print(self.banner) system = InteractiveShell.system_raw displayhook_class = DreplDisplayHook @@ -197,4 +197,4 @@ def drepl_setoptions(self, id, prompts=None): if __name__ == "__main__": - Drepl.instance().mainloop() + launch_new_instance(interactive_shell_class=Drepl)