diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index ff3b5e6..407bb48 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -197,6 +197,10 @@ class InteractiveShellApp(Configurable): """ ) shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') + + def __init__(self, user_ns=None, **kwargs): + self.user_ns = user_ns + super(InteractiveShellApp, self).__init__(**kwargs) def init_path(self): """Add current working directory, '', to sys.path""" diff --git a/IPython/terminal/ipapp.py b/IPython/terminal/ipapp.py index cf0d96e..02ba278 100755 --- a/IPython/terminal/ipapp.py +++ b/IPython/terminal/ipapp.py @@ -334,7 +334,7 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): # so the banner shows *before* all extension loading stuff. self.shell = TerminalInteractiveShell.instance(parent=self, display_banner=False, profile_dir=self.profile_dir, - ipython_dir=self.ipython_dir) + ipython_dir=self.ipython_dir, user_ns=self.user_ns) self.shell.configurables.append(self) def init_banner(self):