sharkdp/fd · error · anyhow::Error

'fd --list-details' is not supported on Windows unless GNU '

Error message

'fd --list-details' is not supported on Windows unless GNU 'ls' is installed.

What it means

Thrown in src/main.rs:484 by the list-details command builder. On Windows fd shells out to an external 'ls' for --list-details output; it probes 'ls --version' and only accepts GNU ls. If 'ls' is missing or is the non-GNU default Windows/dir utility, the feature is unsupported.

Source

Thrown at src/main.rs:484

                cmd
            }
        }
    } else if cfg!(windows) {
        use std::process::{Command, Stdio};

        // Use GNU ls, if available
        let gnu_ls_exists = Command::new("ls")
            .arg("--version")
            .stdout(Stdio::null())
            .stderr(Stdio::null())
            .status()
            .is_ok();

        if gnu_ls_exists {
            gnu_ls("ls")
        } else {
            return Err(anyhow!(
                "'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."
            ));
        }
    } else {
        return Err(anyhow!(
            "'fd --list-details' is not supported on this platform."
        ));
    };
    Ok(cmd)
}

fn extract_time_constraints(opts: &Opts) -> Result<Vec<TimeFilter>> {
    let mut time_constraints: Vec<TimeFilter> = Vec::new();
    if let Some(ref t) = opts.changed_within {
        if let Some(f) = TimeFilter::after(t) {
            time_constraints.push(f);
        } else {
            return Err(anyhow!(

View on GitHub (pinned to 41532d114e)

Solutions

  1. Install GNU coreutils (e.g. via 'winget install GnuWin32 coreutils' or scoop/git), ensure its 'ls' answers 'ls --version' with a GNU banner, and put it on PATH.
  2. Drop --list-details and rely on fd's default output, or pipe to a separate 'stat'/'ls -l' step.
  3. Run inside Git-Bash/MSYS2 where GNU ls is already available.

Example fix

// before (Windows, stock)
fd --list-details

// after (Git-Bash)
scoop install coreutils && fd --list-details
Defensive patterns

Strategy: validation

Validate before calling

# Windows: confirm GNU ls answers --version before using --list-details
if command -v ls >/dev/null 2>&1 && ls --version 2>/dev/null | grep -qi 'gnu'; then
  fd --list-details "$@"
else
  echo "GNU ls required for --list-details on Windows" >&2; exit 1
fi

Prevention

When it happens

Trigger: Running 'fd --list-details' on Windows where GNU coreutils ls is not on PATH (no Git-Bash/MSYS2/GnuWin32 ls, or 'ls' resolves to something that doesn't understand --version).

Common situations: Stock Windows without coreutils; PowerShell where 'ls' aliases to a built-in; PATH ordering putting a non-GNU ls first.

Related errors


AI-assisted analysis of sharkdp/fd@41532d114e (2026-08-06). Data as JSON: /data/errors/52d4b4e992fc9b42.json. Report an issue: GitHub.