{"record":{"id":"d828a15fc1341257","repo":"zellij-org/zellij","slug":"cannot-respawn-plugin-panes","errorCode":null,"errorMessage":"cannot respawn plugin panes","messagePattern":"cannot respawn plugin panes","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"zellij-server/src/pty.rs","lineNumber":1943,"sourceCode":"                self.task_handles.insert(id, terminal_bytes);\n                self.pane_activity_flags.insert(id, activity_flag);\n                if let Some(child_pid) = child_pid {\n                    self.id_to_child_pid.insert(id, child_pid);\n                    self.capture_initial_cwd(id, child_pid);\n                }\n                if let Some(originating_plugin) = self.originating_plugins.get(&id) {\n                    self.bus\n                        .senders\n                        .send_to_plugin(PluginInstruction::Update(vec![(\n                            Some(originating_plugin.plugin_id),\n                            Some(originating_plugin.client_id),\n                            Event::CommandPaneReRun(id, originating_plugin.context.clone()),\n                        )]))\n                        .with_context(err_context)?;\n                }\n                Ok(())\n            },\n            _ => Err(anyhow!(\"cannot respawn plugin panes\")).with_context(err_context),\n        }\n    }\n    pub fn populate_session_layout_metadata(\n        &mut self,\n        session_layout_metadata: &mut SessionLayoutMetadata,\n    ) {\n        let terminal_ids = session_layout_metadata.all_terminal_ids();\n        let mut terminal_ids_to_commands: HashMap<u32, Vec<String>> = HashMap::new();\n        let mut terminal_ids_to_cwds: HashMap<u32, PathBuf> = HashMap::new();\n\n        let pids: Vec<_> = terminal_ids\n            .iter()\n            .filter_map(|id| self.id_to_child_pid.get(&id))\n            .copied()\n            .collect();\n        let (pids_to_cwds, pids_to_cmds) = self\n            .bus\n            .os_input","sourceCodeStart":1925,"sourceCodeEnd":1961,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-server/src/pty.rs#L1925-L1961","documentation":"PtyBus::rerun_command_in_pane matches on PaneId: the Terminal arm spawns a fresh command, while the catch-all arm (PaneId::Plugin) immediately returns this error. Only terminal panes hold a PTY child process that can be re-run; plugin panes have no command to respawn.","triggerScenarios":"An Action that re-runs a pane command (e.g. the 'run command again' / CommandPaneReRun flow) is dispatched with a PaneId::Plugin instead of PaneId::Terminal — usually a caller passing the wrong pane id type or a plugin pane id where a terminal id was expected.","commonSituations":"Plugin code capturing a pane id from an event and feeding it to a re-run/respawn action without checking whether the pane is a terminal; keybindings or sessions scripts that reference a plugin pane's id.","solutions":["Check that the pane you target is a terminal pane, not a plugin pane (pane ids carry an is_plugin flag in the plugin API)","To 'refresh' a plugin pane, use the plugin reload action (start_or_reload_plugin) instead of a command re-run","If developing zellij, return a clearer message naming the PaneId::Plugin case in the catch-all arm"],"exampleFix":"// before (plugin pseudocode)\nrerun_command_in_pane(pane_id); // pane_id may be a plugin pane -> Err\n\n// after (plugin pseudocode)\nif !pane_id.is_plugin {\n    rerun_command_in_pane(pane_id);\n} else {\n    start_or_reload_plugin(&env, &plugin_url);\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn rerunnable(pane_id: PaneId) -> bool {\n    matches!(pane_id, PaneId::Terminal(_))\n}","tryCatchPattern":"match pane_id {\n    PaneId::Terminal(id) => pty.rerun_command_in_pane(pane_id, cmd),\n    PaneId::Plugin(_) => Err(anyhow!(\"cannot respawn plugin panes\")).with_context(err_context),\n}","preventionTips":["Check the pane's is_plugin flag before issuing re-run actions","Use plugin reload actions for plugin panes"],"tags":["pty","plugin","api-misuse","pane","respawn"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}