From b3ab77de27b0bb34f725f541a88f7756c84bf8f6 Mon Sep 17 00:00:00 2001 From: riChar Date: Wed, 18 Jun 2025 19:41:09 +0800 Subject: [PATCH] Fix the current directory change issue upon activation of a relocatable venv within fish --- crates/uv-virtualenv/src/virtualenv.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/uv-virtualenv/src/virtualenv.rs b/crates/uv-virtualenv/src/virtualenv.rs index a641e5541..b877cd41c 100644 --- a/crates/uv-virtualenv/src/virtualenv.rs +++ b/crates/uv-virtualenv/src/virtualenv.rs @@ -300,7 +300,7 @@ pub(crate) fn create( } (true, "activate.bat") => r"%~dp0..".to_string(), (true, "activate.fish") => { - r#"'"$(dirname -- "$(cd "$(dirname -- "$(status -f)")"; and pwd)")"'"#.to_string() + r#""$(dirname -- "$(dirname -- "$(realpath -- "$(status filename)")")")""#.to_string() } // Note: // * relocatable activate scripts appear not to be possible in csh and nu shell