fix: replace Unix path assumptions with cross-platform isAbsolutePath
Windows daemon paths like C:\Users\... don't start with "/", breaking the explorer sidebar, checkout status, terminals, and file attachments when connected to a Windows daemon. Consolidate three private isAbsolutePath implementations into a shared utility and use it everywhere, with correct file URI conversion for Windows and UNC paths.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { execFileSync, execSync } from "node:child_process";
|
||||
import { existsSync } from "node:fs";
|
||||
import { platform } from "node:os";
|
||||
import path from "node:path";
|
||||
import { shellEnvSync } from "shell-env";
|
||||
import { z } from "zod";
|
||||
|
||||
@@ -106,7 +107,7 @@ function resolveExecutableFromWhichOutput(
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!candidate.startsWith("/")) {
|
||||
if (!path.isAbsolute(candidate)) {
|
||||
console.warn(
|
||||
`[findExecutable] Ignoring non-absolute ${source} output for '${name}': ${JSON.stringify(candidate)}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user