diff --git a/yazi-config/preset/yazi.toml b/yazi-config/preset/yazi.toml index e9d46403..f8438347 100644 --- a/yazi-config/preset/yazi.toml +++ b/yazi-config/preset/yazi.toml @@ -12,6 +12,7 @@ linemode = "none" show_hidden = false show_symlink = true scrolloff = 5 +shell = "sh" [preview] tab_size = 2 diff --git a/yazi-config/src/manager/manager.rs b/yazi-config/src/manager/manager.rs index 27f4acaa..2c25b1c8 100644 --- a/yazi-config/src/manager/manager.rs +++ b/yazi-config/src/manager/manager.rs @@ -20,6 +20,7 @@ pub struct Manager { pub show_hidden: bool, pub show_symlink: bool, pub scrolloff: u8, + pub shell: String, } impl Default for Manager { diff --git a/yazi-plugin/src/external/shell.rs b/yazi-plugin/src/external/shell.rs index 76d1ca73..a6028806 100644 --- a/yazi-plugin/src/external/shell.rs +++ b/yazi-plugin/src/external/shell.rs @@ -2,6 +2,7 @@ use std::{env, ffi::OsString, process::Stdio}; use anyhow::Result; use tokio::process::{Child, Command}; +use yazi_config::MANAGER; pub struct ShellOpt { pub cmd: OsString, @@ -33,7 +34,7 @@ pub fn shell(opt: ShellOpt) -> Result { #[cfg(unix)] return Ok(unsafe { - Command::new("sh") + Command::new(&MANAGER.shell) .env("YAZI_LEVEL", (level + 1).to_string()) .arg("-c") .stdin(opt.stdio())