How can I detect programmatically, whether a panel is open/visible or closed/hidden?
The following doesn’t work, it never opens a panel
def run(self):
panels = self.window.panels()
if "console" in panels:
self.window.run_command("hide_panel", {"panel": "console"})
else:
self.window.run_command("show_panel", {"panel": "console"})