From 06870bd5bd9bd6eb3a01daf56f858fc531f3f05b Mon Sep 17 00:00:00 2001 From: Odysseas Stavrou Date: Sat, 5 Sep 2026 04:09:31 +0300 Subject: [PATCH] Fix volshell on IPython>=9.17.0 --- volatility3/cli/volshell/generic.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/volatility3/cli/volshell/generic.py b/volatility3/cli/volshell/generic.py index 2a8039ff2..3b8539cab 100644 --- a/volatility3/cli/volshell/generic.py +++ b/volatility3/cli/volshell/generic.py @@ -25,7 +25,8 @@ except ImportError: has_capstone = False try: - from IPython import terminal + from IPython.terminal import embed, prompts + from traitlets import config as traitlets_config has_ipython = True @@ -135,16 +136,16 @@ class Volshell(interfaces.plugins.PluginInterface): combined_locals.update(self._construct_locals_dict()) if has_ipython: - class LayerNamePrompt(terminal.prompts.Prompts): + class LayerNamePrompt(prompts.Prompts): def in_prompt_tokens(self, cli=None): slf = self.shell.user_ns.get("self") layer_name = slf.current_layer if slf else "no_layer" - return [(terminal.prompts.Token.Prompt, f"[{layer_name}]> ")] + return [(prompts.Token.Prompt, f"[{layer_name}]> ")] c = traitlets_config.Config() c.TerminalInteractiveShell.prompts_class = LayerNamePrompt c.InteractiveShellEmbed.banner2 = banner - self.__console = terminal.embed.InteractiveShellEmbed( + self.__console = embed.InteractiveShellEmbed( config=c, user_ns=combined_locals ) else: