1
0
Эх сурвалжийг харах

fix(tui): normalize abbreviated home paths to forward slashes

Dax Raad 1 сар өмнө
parent
commit
cd942d0669

+ 2 - 1
packages/tui/src/runtime.tsx

@@ -5,5 +5,6 @@ export function abbreviateHome(input: string, home: string) {
   const relative = path.relative(home, input)
   const relative = path.relative(home, input)
   if (relative === "") return "~"
   if (relative === "") return "~"
   if (relative === ".." || relative.startsWith(".." + path.sep) || path.isAbsolute(relative)) return input
   if (relative === ".." || relative.startsWith(".." + path.sep) || path.isAbsolute(relative)) return input
-  return "~" + path.sep + relative
+  // Normalize to forward slashes so abbreviated display paths are identical across platforms.
+  return "~/" + relative.split(path.sep).join("/")
 }
 }