code: def add_shellwidget(self, shellwidget):
          
          shellwidget_id = id(shellwidget)
          if shellwidget_id not in self.shellwidgets:
              self.options_button.setVisible(True)
              fig_browser = FigureBrowser(
                  self, options_button=self.options_button,
                  background_color=MAIN_BG_COLOR)
              fig_browser.set_shellwidget(shellwidget)
              fig_browser.setup(**self.get_settings())
              fig_browser.sig_option_changed.connect(
                  self.sig_option_changed.emit)
              fig_browser.thumbnails_sb.redirect_stdio.connect(
                  self.main.redirect_internalshell_stdio)
              self.register_widget_shortcuts(fig_browser)
              self.add_widget(fig_browser)
              self.shellwidgets[shellwidget_id] = fig_browser
              self.set_shellwidget_from_id(shellwidget_id)
              return fig_browser
docs: Register shell with figure explorer.
  
          This function opens a new FigureBrowser for browsing the figures
          in the shell.