'Register shell with variable explorer.
This function opens a new NamespaceBrowser for browsing the variables
in the shell.'

def add_shellwidget(self, shellwidget):

    shellwidget_id = id(shellwidget)
    if (shellwidget_id not in self.shellwidgets):
        nsb = NamespaceBrowser(self)
        nsb.set_shellwidget(shellwidget)
        nsb.setup(**self.get_settings())
        nsb.sig_option_changed.connect(self.change_option)
        self.add_widget(nsb)
        self.shellwidgets[shellwidget_id] = nsb
        self.set_shellwidget_from_id(shellwidget_id)
        return nsb
