diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index 6aed2e7..24f6825 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -163,6 +163,11 @@ class InteractiveShellApp(Configurable): # Extensions that are always loaded (not configurable) default_extensions = List(Unicode, [u'storemagic'], config=False) + + hide_initial_ns = Bool(True, config=True, + help="""Should variables loaded at startup (by startup files, exec_lines, etc.) + be hidden from tools like %who?""" + ) exec_files = List(Unicode, config=True, help="""List of files to run at IPython startup.""" @@ -290,7 +295,8 @@ class InteractiveShellApp(Configurable): sys.stderr.flush() # Hide variables defined here from %who etc. - self.shell.user_ns_hidden.update(self.shell.user_ns) + if self.hide_initial_ns: + self.shell.user_ns_hidden.update(self.shell.user_ns) def _run_exec_lines(self): """Run lines of code in IPythonApp.exec_lines in the user's namespace."""