{"record":{"id":"57a5f3afe64de600","repo":"zed-industries/zed","slug":"failed-to-convert-path-to-wsl-path","errorCode":null,"errorMessage":"Failed to convert path to WSL path: {:?}","messagePattern":"Failed to convert path to WSL path: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/repl/src/kernels/wsl_kernel.rs","lineNumber":133,"sourceCode":"            // yeah we can't assume this is available on WSL.\n            // running `wsl -d <distro> wslpath -u <windows_path>`\n            let mut wslpath_cmd = util::command::new_command(\"wsl\");\n\n            // On Windows, passing paths with backslashes to wsl.exe can sometimes cause\n            // escaping issues or be misinterpreted. Converting to forward slashes is safer\n            // and often accepted by wslpath.\n            let connection_path_str = connection_path.to_string_lossy().replace('\\\\', \"/\");\n\n            wslpath_cmd\n                .arg(\"-d\")\n                .arg(&kernel_specification.distro)\n                .arg(\"wslpath\")\n                .arg(\"-u\")\n                .arg(&connection_path_str);\n\n            let output = wslpath_cmd.output().await?;\n            if !output.status.success() {\n                anyhow::bail!(\"Failed to convert path to WSL path: {:?}\", output);\n            }\n            let wsl_connection_path = String::from_utf8_lossy(&output.stdout).trim().to_string();\n\n            // Construct the kernel command\n            // The kernel spec argv might have absolute paths valid INSIDE WSL.\n            // We need to run inside WSL.\n            // `wsl -d <distro> --exec <argv0> <argv1> ...`\n            // But we need to replace {connection_file} with wsl_connection_path.\n\n            anyhow::ensure!(\n                !kernel_specification.kernelspec.argv.is_empty(),\n                \"Empty argv in kernelspec {}\",\n                kernel_specification.name\n            );\n\n            let working_directory_str = working_directory.to_string_lossy().replace('\\\\', \"/\");\n\n            let wsl_working_directory = if working_directory_str.starts_with('/') {","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/repl/src/kernels/wsl_kernel.rs#L115-L151","documentation":"Raised in the WSL kernel constructor when `wsl -d <distro> wslpath -u <path>` exits non-zero. The wslpath output status (shown via {:?}) is the fault; the kernel's Windows-side connection file path could not be translated into a WSL-visible path, so the kernel command line cannot be built.","triggerScenarios":"Thrown at crates/repl/src/kernels/wsl_kernel.rs:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify `wsl` and `wslpath` work inside the target distribution (`wsl -d <distro> wslpath -u <path>`)","Check the distro name passed with -d matches an installed distribution","Ensure the Windows path exists before conversion","Fall back to a manual path if the connection file must be pre-created"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}