From b5e65a8c6c538cbfa4fc09887d22c4e66faf69c8 Mon Sep 17 00:00:00 2001 From: rrveex Date: Tue, 27 Feb 2024 15:17:07 +0200 Subject: [PATCH] shell setting --- yazi-config/preset/yazi.toml | 1 + yazi-config/src/manager/manager.rs | 1 + yazi-plugin/src/external/shell.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) 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())