From 4b04cb24b47b3dd896627d305393d3d187e93f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Mon, 15 Apr 2024 16:16:09 +0800 Subject: [PATCH] feat: allow creating a tab with the startup directory when the `tab_create` command is called without specifying a `path` parameter (#917) --- 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, + } } } }