zed-industries/zed · error
`bwrap` resolved to {bwrap_path:?} rather than an absolute p
Error message
`bwrap` resolved to {bwrap_path:?} rather than an absolute path; a shell alias or function named `bwrap` cannot be run with `wsl --exec` What it means
The environment probe resolved bwrap to a relative path, meaning a shell alias or function named bwrap was found instead of the real binary. `wsl --exec` bypasses the shell, so such an alias cannot be used to run the sandbox.
Source
Thrown at crates/sandbox/src/windows_wsl.rs:838
/// Parse [`probe_script`] output: the last [`PROBE_RESULT_PREFIX`]-marked
/// line wins, so stdout noise from login-shell profile scripts (which runs
/// before the script body) is ignored.
fn parse_probe_output(stdout: &str) -> Result<EnvironmentProbe> {
let line = stdout
.lines()
.rev()
.find_map(|line| line.strip_prefix(PROBE_RESULT_PREFIX))
.with_context(|| format!("no probe result line in: {stdout:?}"))?;
let (interop, bwrap_path) = line
.trim_start()
.split_once(' ')
.with_context(|| format!("malformed probe result line: {line:?}"))?;
let mask_interop_dir = match interop {
"interop" => true,
"no-interop" => false,
_ => bail!("malformed probe result line: {line:?}"),
};
ensure!(
bwrap_path.starts_with('/'),
"`bwrap` resolved to {bwrap_path:?} rather than an absolute path; a shell \
alias or function named `bwrap` cannot be run with `wsl --exec`"
);
Ok(EnvironmentProbe {
mask_interop_dir,
bwrap_path: bwrap_path.to_string(),
})
}
/// Ensure a Linux `zed` of the given release `channel`/`version` is available
/// inside WSL and return its absolute in-WSL path, to be `--exec`'d as the
/// `--wsl-sandbox-helper`. Runs [`HELPER_PROVISION_SCRIPT`] (which downloads the
/// matching release tarball into an off-`PATH` location on first use).
///
/// Successful resolutions are cached per `(distro, channel, version)` for the
/// life of the process — once provisioned, the path won't change. Failures are
/// not cached, so a user who installs `curl` (or fixes networking) after anView on GitHub (pinned to f4178619ac)
Solutions
- Install the real bwrap binary on PATH inside the WSL distro
- Remove or rename the bwrap shell alias/function so resolution finds the actual executable
- Set ZED_WSL_BWRAP (or equivalent) to the absolute bwrap path
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/sandbox/src/windows_wsl.rs:838 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/7f7591ff3947e84d.
Report an issue: GitHub.