Show More
@@ -98,6 +98,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
98 | 98 | |
|
99 | 99 | pt_cli = None |
|
100 | 100 | debugger_history = None |
|
101 | _pt_app = None | |
|
101 | 102 | |
|
102 | 103 | simple_prompt = Bool(_use_simple_prompt, |
|
103 | 104 | help="""Use `raw_input` for the REPL, without completion, multiline input, and prompt colors. |
@@ -203,7 +204,6 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
203 | 204 | self.display_formatter.active_types = ['text/plain'] |
|
204 | 205 | |
|
205 | 206 | def init_prompt_toolkit_cli(self): |
|
206 | self._app = None | |
|
207 | 207 | if self.simple_prompt: |
|
208 | 208 | # Fall back to plain non-interactive output for tests. |
|
209 | 209 | # This is very limited, and only accepts a single line. |
@@ -350,7 +350,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
350 | 350 | |
|
351 | 351 | editing_mode = getattr(EditingMode, self.editing_mode.upper()) |
|
352 | 352 | |
|
353 | self._app = create_prompt_application( | |
|
353 | self._pt_app = create_prompt_application( | |
|
354 | 354 | editing_mode=editing_mode, |
|
355 | 355 | key_bindings_registry=kbmanager.registry, |
|
356 | 356 | history=history, |
@@ -361,7 +361,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
361 | 361 | **self._layout_options() |
|
362 | 362 | ) |
|
363 | 363 | self._eventloop = create_eventloop(self.inputhook) |
|
364 | self.pt_cli = CommandLineInterface(self._app, eventloop=self._eventloop) | |
|
364 | self.pt_cli = CommandLineInterface(self._pt_app, eventloop=self._eventloop) | |
|
365 | 365 | |
|
366 | 366 | def _make_style_from_name(self, name): |
|
367 | 367 | """ |
@@ -439,8 +439,8 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
439 | 439 | Ask for a re computation of the application layout, if for example , |
|
440 | 440 | some configuration options have changed. |
|
441 | 441 | """ |
|
442 |
if |
|
|
443 | self._app.layout = create_prompt_layout(**self._layout_options()) | |
|
442 | if self._pt_app: | |
|
443 | self._pt_app.layout = create_prompt_layout(**self._layout_options()) | |
|
444 | 444 | |
|
445 | 445 | def prompt_for_code(self): |
|
446 | 446 | document = self.pt_cli.run( |
@@ -570,6 +570,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
570 | 570 | elif self._prompts_before: |
|
571 | 571 | self.prompts = self._prompts_before |
|
572 | 572 | self._prompts_before = None |
|
573 | self._update_layout() | |
|
573 | 574 | |
|
574 | 575 | |
|
575 | 576 | InteractiveShellABC.register(TerminalInteractiveShell) |
General Comments 0
You need to be logged in to leave comments.
Login now