code: def register_plugin(self):
          
          self.focus_changed.connect(self.main.plugin_focus_changed)
          self.main.add_dockwidget(self)
          self.main.console.set_help(self)
  
          self.internal_shell = self.main.console.shell
          self.console = self.main.console
docs: Register plugin in Spyder's main window