ajeetdsouza/zoxide · error · anyhow::Error

fzf was terminated

Error message

fzf was terminated

What it means

Error "fzf was terminated" thrown in ajeetdsouza/zoxide.

Source

Thrown at src/util.rs:147

            Err(e) => Err(e).context("could not write to fzf"),
        }
    }

    pub fn wait(&mut self) -> Result<String> {
        // Drop stdin to prevent deadlock.
        mem::drop(self.0.stdin.take());

        let mut stdout = self.0.stdout.take().unwrap();
        let mut output = String::new();
        stdout.read_to_string(&mut output).context("failed to read from fzf")?;

        let status = self.0.wait().context("wait failed on fzf")?;
        match status.code() {
            Some(0) => Ok(output),
            Some(1) => bail!("no match found"),
            Some(2) => bail!("fzf returned an error"),
            Some(130) => bail!(SilentExit { code: 130 }),
            Some(128..=254) | None => bail!("fzf was terminated"),
            _ => bail!("fzf returned an unknown error"),
        }
    }
}

/// Similar to [`fs::write`], but atomic (best effort on Windows).
pub fn write(path: impl AsRef<Path>, contents: impl AsRef<[u8]>) -> Result<()> {
    let path = path.as_ref();
    let contents = contents.as_ref();
    let dir = path.parent().unwrap();

    // Create a tmpfile.
    let (mut tmp_file, tmp_path) = tmpfile(dir)?;
    let result = (|| {
        // Write to the tmpfile.
        _ = tmp_file.set_len(contents.len() as u64);
        tmp_file
            .write_all(contents)

View on GitHub (pinned to 8a3f76da90)

Solutions

  1. Re-run the command; fzf exits with this status when the user aborts the selection (e.g. pressing Esc)

When it happens

Trigger: Thrown at src/util.rs:147 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ajeetdsouza/zoxide@8a3f76da90 (2026-08-19). Data as JSON: /api/errors/8b23529366b335e8. Report an issue: GitHub.