Show More
@@ -20,6 +20,11 b' from prompt_toolkit import __version__ as ptk_version' | |||
|
20 | 20 | PTK3 = ptk_version.startswith('3.') |
|
21 | 21 | |
|
22 | 22 | |
|
23 | # we want to avoid ptk as much as possible when using subprocesses | |
|
24 | # as it uses cursor positioning requests, deletes color .... | |
|
25 | _use_simple_prompt = "IPY_TEST_SIMPLE_PROMPT" in os.environ | |
|
26 | ||
|
27 | ||
|
23 | 28 | class TerminalPdb(Pdb): |
|
24 | 29 | """Standalone IPython debugger.""" |
|
25 | 30 | |
@@ -87,8 +92,9 b' class TerminalPdb(Pdb):' | |||
|
87 | 92 | if not PTK3: |
|
88 | 93 | options['inputhook'] = self.shell.inputhook |
|
89 | 94 | options.update(pt_session_options) |
|
90 | self.pt_loop = asyncio.new_event_loop() | |
|
91 | self.pt_app = PromptSession(**options) | |
|
95 | if not _use_simple_prompt: | |
|
96 | self.pt_loop = asyncio.new_event_loop() | |
|
97 | self.pt_app = PromptSession(**options) | |
|
92 | 98 | |
|
93 | 99 | def cmdloop(self, intro=None): |
|
94 | 100 | """Repeatedly issue a prompt, accept input, parse an initial prefix |
@@ -121,10 +127,15 b' class TerminalPdb(Pdb):' | |||
|
121 | 127 | self._ptcomp.ipy_completer.global_namespace = self.curframe.f_globals |
|
122 | 128 | |
|
123 | 129 | # Run the prompt in a different thread. |
|
124 |
|
|
|
125 | line = self.thread_executor.submit(self.pt_app.prompt).result() | |
|
126 | except EOFError: | |
|
127 | line = "EOF" | |
|
130 | if not _use_simple_prompt: | |
|
131 | try: | |
|
132 | line = self.thread_executor.submit( | |
|
133 | self.pt_app.prompt | |
|
134 | ).result() | |
|
135 | except EOFError: | |
|
136 | line = "EOF" | |
|
137 | else: | |
|
138 | line = input("ipdb> ") | |
|
128 | 139 | |
|
129 | 140 | line = self.precmd(line) |
|
130 | 141 | stop = self.onecmd(line) |
General Comments 0
You need to be logged in to leave comments.
Login now