{"record":{"id":"927cdb44507d2863","repo":"zellij-org/zellij","slug":"post-command-discovery-hook-failed-to-run-e","errorCode":null,"errorMessage":"post command discovery hook failed to run: {e}","messagePattern":"post command discovery hook failed to run: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"zellij-server/src/os_input_output.rs","lineNumber":753,"sourceCode":"impl Drop for ResizeCache {\n    fn drop(&mut self) {\n        self.senders\n            .send_to_pty_writer(PtyWriteInstruction::ApplyCachedResizes)\n            .unwrap_or_else(|e| {\n                log::error!(\"Failed to apply cached resizes: {}\", e);\n            });\n    }\n}\n\nfn apply_post_command_hook(command: Vec<String>, post_hook: &Option<String>) -> Vec<String> {\n    let Some(post_hook) = post_hook else {\n        return command;\n    };\n    let stringified = command.join(\" \");\n    let cmd = match run_command_hook(&stringified, post_hook) {\n        Ok(command) => command,\n        Err(e) => {\n            Err::<(), _>(anyhow!(\"post command discovery hook failed to run: {e}\")).non_fatal();\n            stringified\n        },\n    };\n    cmd.trim()\n        .split_ascii_whitespace()\n        .map(|p| p.to_owned())\n        .collect()\n}\n\n#[cfg(not(windows))]\nfn run_command_hook(\n    original_command: &str,\n    hook_script: &str,\n) -> Result<String, Box<dyn std::error::Error>> {\n    let output = Command::new(\"sh\")\n        .arg(\"-c\")\n        .arg(hook_script)\n        .env(\"RESURRECT_COMMAND\", original_command)","sourceCodeStart":735,"sourceCodeEnd":771,"githubUrl":"https://github.com/zellij-org/zellij/blob/bf8d23a4f774abf27a108da2a1a2689e7d8d0d23/zellij-server/src/os_input_output.rs#L735-L771","documentation":"Error \"post command discovery hook failed to run: {e}\" thrown in zellij-org/zellij.","triggerScenarios":"Occurs at zellij-server/src/os_input_output.rs:753 when the operation fails: \"post command discovery hook failed to run: {e}\". Currently there is no defensive handling preventing or contextualizing this failure before it surfaces.","commonSituations":"Occurs on startup or command discovery when an external hook script fails.","solutions":["Check that the configured post command discovery hook exists and is executable.","Inspect the hook's stderr output and fix or remove the hook in the configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf8d23a4f774abf27a108da2a1a2689e7d8d0d23","analyzedAt":"2026-08-19T07:42:58.758Z","contentChangedAt":"2026-08-19T07:42:58.758Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}