Show More
@@ -62,11 +62,15 b' class RichPromptDisplayHook(DisplayHook):' | |||
|
62 | 62 | """Subclass of base display hook using coloured prompt""" |
|
63 | 63 | def write_output_prompt(self): |
|
64 | 64 | sys.stdout.write(self.shell.separate_out) |
|
65 | self.prompt_end_newline = False | |
|
65 | # If we're not displaying a prompt, it effectively ends with a newline, | |
|
66 | # because the output will be left-aligned. | |
|
67 | self.prompt_end_newline = True | |
|
68 | ||
|
66 | 69 | if self.do_full_cache: |
|
67 | 70 | tokens = self.shell.prompts.out_prompt_tokens() |
|
68 | if tokens and tokens[-1][1].endswith('\n'): | |
|
69 | self.prompt_end_newline = True | |
|
71 | if tokens and not tokens[-1][1].endswith('\n'): | |
|
72 | # Ask for a newline before multiline output | |
|
73 | self.prompt_end_newline = False | |
|
70 | 74 | if self.shell.pt_cli: |
|
71 | 75 | self.shell.pt_cli.print_tokens(tokens) |
|
72 | 76 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now