zellij-org/zellij · error

post command discovery hook failed to run: {e}

Error message

post command discovery hook failed to run: {e}

What it means

Error "post command discovery hook failed to run: {e}" thrown in zellij-org/zellij.

Source

Thrown at zellij-server/src/os_input_output.rs:753

impl Drop for ResizeCache {
    fn drop(&mut self) {
        self.senders
            .send_to_pty_writer(PtyWriteInstruction::ApplyCachedResizes)
            .unwrap_or_else(|e| {
                log::error!("Failed to apply cached resizes: {}", e);
            });
    }
}

fn apply_post_command_hook(command: Vec<String>, post_hook: &Option<String>) -> Vec<String> {
    let Some(post_hook) = post_hook else {
        return command;
    };
    let stringified = command.join(" ");
    let cmd = match run_command_hook(&stringified, post_hook) {
        Ok(command) => command,
        Err(e) => {
            Err::<(), _>(anyhow!("post command discovery hook failed to run: {e}")).non_fatal();
            stringified
        },
    };
    cmd.trim()
        .split_ascii_whitespace()
        .map(|p| p.to_owned())
        .collect()
}

#[cfg(not(windows))]
fn run_command_hook(
    original_command: &str,
    hook_script: &str,
) -> Result<String, Box<dyn std::error::Error>> {
    let output = Command::new("sh")
        .arg("-c")
        .arg(hook_script)
        .env("RESURRECT_COMMAND", original_command)

View on GitHub (pinned to bf8d23a4f7)

Solutions

  1. Check that the configured post command discovery hook exists and is executable.
  2. Inspect the hook's stderr output and fix or remove the hook in the configuration.

When it happens

Trigger: 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.

Common situations: Occurs on startup or command discovery when an external hook script fails.


AI-assisted analysis of zellij-org/zellij@bf8d23a4f7 (2026-08-19). Data as JSON: /api/errors/927cdb44507d2863. Report an issue: GitHub.