shell setting

This commit is contained in:
rrveex 2024-02-27 15:17:07 +02:00
parent 82071bd06b
commit b5e65a8c6c
3 changed files with 4 additions and 1 deletions

View file

@ -12,6 +12,7 @@ linemode = "none"
show_hidden = false
show_symlink = true
scrolloff = 5
shell = "sh"
[preview]
tab_size = 2

View file

@ -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 {

View file

@ -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<Child> {
#[cfg(unix)]
return Ok(unsafe {
Command::new("sh")
Command::new(&MANAGER.shell)
.env("YAZI_LEVEL", (level + 1).to_string())
.arg("-c")
.stdin(opt.stdio())