mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: fd binary name detection
This commit is contained in:
parent
362fbebcc5
commit
d5dac789b3
3 changed files with 14 additions and 7 deletions
|
|
@ -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"))?;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
12
yazi-plugin/src/external/fd.rs
vendored
12
yazi-plugin/src/external/fd.rs
vendored
|
|
@ -1,7 +1,11 @@
|
|||
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 {
|
||||
|
|
@ -11,8 +15,10 @@ pub struct FdOpt {
|
|||
pub args: Vec<String>,
|
||||
}
|
||||
|
||||
pub fn fd(opt: FdOpt) -> Result<UnboundedReceiver<File>> {
|
||||
let mut child = Command::new("fd")
|
||||
pub async fn fd(opt: FdOpt) -> Result<UnboundedReceiver<File>> {
|
||||
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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue