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, " magick : {}", Self::process_output("magick", "--version"))?;
|
||||||
writeln!(s, " fzf : {}", Self::process_output("fzf", "--version"))?;
|
writeln!(s, " fzf : {}", Self::process_output("fzf", "--version"))?;
|
||||||
writeln!(s, " fd : {}", Self::process_output("fd", "--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, " rg : {}", Self::process_output("rg", "--version"))?;
|
||||||
writeln!(s, " chafa : {}", Self::process_output("chafa", "--version"))?;
|
writeln!(s, " chafa : {}", Self::process_output("chafa", "--version"))?;
|
||||||
writeln!(s, " zoxide : {}", Self::process_output("zoxide", "--version"))?;
|
writeln!(s, " zoxide : {}", Self::process_output("zoxide", "--version"))?;
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ impl Tab {
|
||||||
hidden,
|
hidden,
|
||||||
subject: opt.subject,
|
subject: opt.subject,
|
||||||
args: opt.args,
|
args: opt.args,
|
||||||
})
|
}).await
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
let rx = UnboundedReceiverStream::new(rx).chunks_timeout(1000, Duration::from_millis(300));
|
let rx = UnboundedReceiverStream::new(rx).chunks_timeout(1000, Duration::from_millis(300));
|
||||||
|
|
|
||||||
18
yazi-plugin/src/external/fd.rs
vendored
18
yazi-plugin/src/external/fd.rs
vendored
|
|
@ -1,18 +1,24 @@
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
|
|
||||||
use anyhow::Result;
|
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};
|
use yazi_shared::fs::{File, Url};
|
||||||
|
|
||||||
pub struct FdOpt {
|
pub struct FdOpt {
|
||||||
pub cwd: Url,
|
pub cwd: Url,
|
||||||
pub hidden: bool,
|
pub hidden: bool,
|
||||||
pub subject: String,
|
pub subject: String,
|
||||||
pub args: Vec<String>,
|
pub args: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fd(opt: FdOpt) -> Result<UnboundedReceiver<File>> {
|
pub async fn fd(opt: FdOpt) -> Result<UnboundedReceiver<File>> {
|
||||||
let mut child = Command::new("fd")
|
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("--base-directory")
|
||||||
.arg(&opt.cwd)
|
.arg(&opt.cwd)
|
||||||
.arg("--regex")
|
.arg("--regex")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue