Przeglądaj źródła

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

Dax Raad 1 miesiąc temu
rodzic
commit
cd942d0669
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      packages/tui/src/runtime.tsx

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

@@ -5,5 +5,6 @@ export function abbreviateHome(input: string, home: string) {
   const relative = path.relative(home, input)
   if (relative === "") return "~"
   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("/")
 }