Don't write separator for input prompts
@@ -2406,7 +2406,7 @@ class ConsoleWidget(MetaQObjectHasTraits('NewBase', (LoggingConfigurable, superQ
if password:
self._show_prompt('Warning: QtConsole does not support password mode, '\
'the text you type will be visible.', newline=True)
- self._show_prompt(prompt, newline=False)
+ self._show_prompt(prompt, newline=False, separator=False)
if callback is None:
self._reading_callback = None
@@ -2452,7 +2452,8 @@ class ConsoleWidget(MetaQObjectHasTraits('NewBase', (LoggingConfigurable, superQ
self._control.ensureCursorVisible()
self._control.setTextCursor(original_cursor)
- def _show_prompt(self, prompt=None, html=False, newline=True):
+ def _show_prompt(self, prompt=None, html=False, newline=True,
+ separator=True):
""" Writes a new prompt at the end of the buffer.
Parameters
@@ -2468,6 +2469,9 @@ class ConsoleWidget(MetaQObjectHasTraits('NewBase', (LoggingConfigurable, superQ
newline : bool, optional (default True)
If set, a new line will be written before showing the prompt if
there is not already a newline at the end of the buffer.
+
+ separator : bool, optional (default True)
+ If set, a separator will be written before the prompt.
"""
self._flush_pending_stream()
cursor = self._get_end_cursor()
@@ -2492,6 +2496,7 @@ class ConsoleWidget(MetaQObjectHasTraits('NewBase', (LoggingConfigurable, superQ
self._append_block()
# Write the prompt.
+ if separator:
self._append_plain_text(self._prompt_sep)
if prompt is None:
if self._prompt_html is None:
