From 7420a0d416df8d5e0f2d85548599050484c66298 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 15 Apr 2024 16:12:56 +0800 Subject: [PATCH] feat: allow creating a tab with the startup directory when the `tab_create` command is called without specifying a `path` parameter --- yazi-core/src/manager/commands/tab_create.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yazi-core/src/manager/commands/tab_create.rs b/yazi-core/src/manager/commands/tab_create.rs index fd4671fe..b5f28aa9 100644 --- a/yazi-core/src/manager/commands/tab_create.rs +++ b/yazi-core/src/manager/commands/tab_create.rs @@ -1,3 +1,4 @@ +use yazi_boot::BOOT; use yazi_proxy::AppProxy; use yazi_shared::{event::Cmd, fs::Url, render}; @@ -15,7 +16,10 @@ impl From for Opt { if c.named.contains_key("current") { Self { url: Default::default(), current: true } } else { - Self { url: c.take_first().map_or_else(|| Url::from("."), Url::from), current: false } + Self { + url: c.take_first().map_or_else(|| Url::from(&BOOT.cwd), Url::from), + current: false, + } } } }