Fix the current directory change issue upon activation of a relocatable venv within fish

This commit is contained in:
riChar 2025-06-18 19:41:09 +08:00
parent 4d9c9a1e76
commit b3ab77de27
No known key found for this signature in database
GPG key ID: BBAECBD1456334E4

View file

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