diff --git a/yazi-boot/src/actions/debug.rs b/yazi-boot/src/actions/debug.rs index cf9fb0ad..c0dc4e1d 100644 --- a/yazi-boot/src/actions/debug.rs +++ b/yazi-boot/src/actions/debug.rs @@ -84,6 +84,7 @@ impl Actions { writeln!(s, " magick : {}", Self::process_output("magick", "--version"))?; writeln!(s, " fzf : {}", Self::process_output("fzf", "--version"))?; writeln!(s, " fd : {}", Self::process_output("fd", "--version"))?; + writeln!(s, " fdfind : {}", Self::process_output("fdfind", "--version"))?; writeln!(s, " rg : {}", Self::process_output("rg", "--version"))?; writeln!(s, " chafa : {}", Self::process_output("chafa", "--version"))?; writeln!(s, " zoxide : {}", Self::process_output("zoxide", "--version"))?; diff --git a/yazi-core/src/tab/commands/search.rs b/yazi-core/src/tab/commands/search.rs index d3550db2..83249142 100644 --- a/yazi-core/src/tab/commands/search.rs +++ b/yazi-core/src/tab/commands/search.rs @@ -61,7 +61,7 @@ impl Tab { hidden, subject: opt.subject, args: opt.args, - }) + }).await }?; let rx = UnboundedReceiverStream::new(rx).chunks_timeout(1000, Duration::from_millis(300)); diff --git a/yazi-plugin/src/external/fd.rs b/yazi-plugin/src/external/fd.rs index 74aaca15..f2f6af57 100644 --- a/yazi-plugin/src/external/fd.rs +++ b/yazi-plugin/src/external/fd.rs @@ -1,18 +1,24 @@ use std::process::Stdio; use anyhow::Result; -use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}}; +use tokio::{ + io::{AsyncBufReadExt, BufReader}, + process::Command, + sync::mpsc::{self, UnboundedReceiver}, +}; use yazi_shared::fs::{File, Url}; pub struct FdOpt { - pub cwd: Url, - pub hidden: bool, + pub cwd: Url, + pub hidden: bool, pub subject: String, - pub args: Vec, + pub args: Vec, } -pub fn fd(opt: FdOpt) -> Result> { - let mut child = Command::new("fd") +pub async fn fd(opt: FdOpt) -> Result> { + let cmd_name = if Command::new("fd").arg("-V").status().await.is_ok() { "fd" } else { "fdfind" }; + + let mut child = Command::new(cmd_name) .arg("--base-directory") .arg(&opt.cwd) .arg("--regex")