Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions IPython/qt/console/frontend_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,11 @@ def reset(self, clear=False):

if clear:
self._control.clear()
self._append_plain_text(self.banner)
if self.kernel_banner:
self._append_plain_text(self.kernel_banner)

if self._display_banner:
self._append_plain_text(self.banner)
if self.kernel_banner:
self._append_plain_text(self.kernel_banner)

# update output marker for stdout/stderr, so that startup
# messages appear after banner:
self._append_before_prompt_pos = self._get_cursor().position()
Expand Down
11 changes: 11 additions & 0 deletions IPython/qt/console/qtconsoleapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def gui_excepthook(exctype, value, tb):
from IPython.external.qt import QtCore, QtGui

# Local imports
from IPython.config.application import boolean_flag
from IPython.config.application import catch_config_error
from IPython.core.application import BaseIPythonApplication
from IPython.qt.console.ipython_widget import IPythonWidget
Expand Down Expand Up @@ -91,6 +92,11 @@ def gui_excepthook(exctype, value, tb):
'plain' : ({'IPythonQtConsoleApp' : {'plain' : True}},
"Disable rich text support."),
}
qt_flags.update(boolean_flag(
'banner', 'IPythonQtConsoleApp.display_banner',
"Display a banner upon starting the QtConsole.",
"Don't display a banner upon starting the QtConsole."
))

# and app_flags from the Console Mixin
qt_flags.update(app_flags)
Expand Down Expand Up @@ -168,6 +174,10 @@ class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp):
plain = CBool(False, config=True,
help="Use a plaintext widget instead of rich text (plain can't print/save).")

display_banner = CBool(True, config=True,
help="Whether to display a banner upon starting the QtConsole."
)

def _plain_changed(self, name, old, new):
kind = 'plain' if new else 'rich'
self.config.ConsoleWidget.kind = kind
Expand Down Expand Up @@ -255,6 +265,7 @@ def init_qt_elements(self):
self.widget._existing = self.existing
self.widget._may_close = not self.existing
self.widget._confirm_exit = self.confirm_exit
self.widget._display_banner = self.display_banner

self.widget.kernel_manager = self.kernel_manager
self.widget.kernel_client = self.kernel_client
Expand Down