fix(tui): normalize abbreviated home paths to forward slashes
This commit is contained in:
parent
4741e3ee6b
commit
cd942d0669
1 changed files with 2 additions and 1 deletions
|
|
@ -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("/")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue