Skip to content

Commit 97a86b7

Browse files
authored
fix(tui): use path.sep for plugin name extraction in /status dialog (anomalyco#52328)
1 parent 2fa3363 commit 97a86b7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/tui/src/component/dialog-status.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { TextAttributes } from "@opentui/core"
22
import { fileURLToPath } from "bun"
3+
import path from "path"
34
import { useTheme } from "../context/theme"
45
import { useDialog } from "../ui/dialog"
56
import { useSync } from "../context/sync"
@@ -19,9 +20,9 @@ export function DialogStatus() {
1920
const result = list.map((item) => {
2021
const value = typeof item === "string" ? item : item[0]
2122
if (value.startsWith("file://")) {
22-
const path = fileURLToPath(value)
23-
const parts = path.split("/")
24-
const filename = parts.pop() || path
23+
const filePath = fileURLToPath(value)
24+
const parts = filePath.split(path.sep)
25+
const filename = parts.pop() || filePath
2526
if (!filename.includes(".")) return { name: filename }
2627
const basename = filename.split(".")[0]
2728
if (basename === "index") {

0 commit comments

Comments
 (0)