zed-industries/zed · error
path is not absolute: {path}
Error message
path is not absolute: {path} What it means
Raised in parse_native_drive_path when, after stripping a possible \\?\ prefix, the string is not a Windows drive-letter absolute path: the first char is not an alphabetic drive letter, or the second char is not ':'. The {path} shown is the malformed input.
Source
Thrown at crates/sandbox/src/windows_wsl.rs:1512
_ => "/".to_string(),
};
Ok(WslPath {
distro: Some(distro.to_string()),
path: linux_path,
})
}
fn parse_native_drive_path(path: &str) -> Result<WslPath> {
let path = path
.strip_prefix("\\\\?\\")
.unwrap_or(path)
.replace('\\', "/");
let mut chars = path.chars();
let Some(drive) = chars.next().filter(|drive| drive.is_ascii_alphabetic()) else {
bail!("path is not a drive-letter Windows path: {path}");
};
ensure!(chars.next() == Some(':'), "path is not absolute: {path}");
let rest = chars.as_str().trim_start_matches('/');
let drive = drive.to_ascii_lowercase();
let linux_path = if rest.is_empty() {
format!("/mnt/{drive}")
} else {
format!("/mnt/{drive}/{rest}")
};
Ok(WslPath {
distro: None,
path: linux_path,
})
}
#[cfg(test)]
mod tests {
use super::*;
#[test]View on GitHub (pinned to f4178619ac)
Solutions
- Pass a fully-qualified drive-letter path such as C:\dir\file
- Handle UNC (\\server\share) or WSL (/mnt/...) paths through their own resolvers instead
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/sandbox/src/windows_wsl.rs:1512 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/edde0b6854781ae1.
Report an issue: GitHub.