From 78d342d582d26dfe75ad2d798db9e330bb98aa84 Mon Sep 17 00:00:00 2001 From: Remco Smits Date: Fri, 3 Jan 2025 22:10:01 +0100 Subject: [PATCH] Fix CWD is not correctly respected when appending child paths Right now when you add `"cwd": "$ZED_WORKTREE_ROOT/some/path"` to your config, it won't work as expected. Because we only added the `cwd` to the task template when the cwd was a valid path. But when you add `"cwd": "$ZED_WORKTREE_ROOT` to your config, it will never be a valid path, so the `cwd` will never be added to the task template and fallback to the `$ZED_WORKTREE_ROOT` already. So by just always adding it to the task template, we will try to resolve it and otherwise fallback to the `$ZED_WORKTREE_ROOT`. --- crates/task/src/debug_format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/task/src/debug_format.rs b/crates/task/src/debug_format.rs index 83f91047d9..1cd8492c54 100644 --- a/crates/task/src/debug_format.rs +++ b/crates/task/src/debug_format.rs @@ -185,7 +185,7 @@ impl DebugTaskDefinition { command, args, task_type, - cwd: if cwd.is_some() { self.cwd } else { None }, + cwd: self.cwd, ..Default::default() }) }