From 58e4653a04f5ca5081a7153d92f6b00741f2d0e2 2021-08-15 21:20:11 From: Artur Svistunov <18216480+madbird1304@users.noreply.github.com> Date: 2021-08-15 21:20:11 Subject: [PATCH] Fixed: Issue https://github.com/ipython/ipython/issues/12897 Problem: Changing to vi mode via config magic makes repl stop reacting to almost all keyboard input. Solution: Recreating prompt tookit app every time editing mode changed. --- diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 0fa9028..9321946 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -203,10 +203,10 @@ class TerminalInteractiveShell(InteractiveShell): @observe('editing_mode') - def _editing_mode(self, change): + def _editing_mode_changed(self, change): u_mode = change.new.upper() if self.pt_app: - self.pt_app.editing_mode = u_mode + self.init_prompt_toolkit_cli() @observe('autoformatter') def _autoformatter_changed(self, change):