diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index f088cc5b8f..7048f97455 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1875,14 +1875,14 @@ function Read(props: ToolProps) { part={props.part} > Read {normalizePath(props.input.filePath!)} {input(props.input, ["filePath"])} - - {(filepath) => ( - <> - {"\n"}↳{" "}Loaded {normalizePath(filepath)} - - )} - + + {(filepath) => ( + + ⤷ Loaded {normalizePath(filepath)} + + )} + ) } @@ -1985,12 +1985,12 @@ function Task(props: ToolProps) { 0}> {" "} · {tools().length} toolcalls - - {"\n"}↳ {Locale.titlecase(current()!.tool)} {(current()!.state as any).title} + + {"\n"}⤷ {Locale.titlecase(current()!.tool)} {(current()!.state as any).title} - {"\n ↳ "} + {"\n ⤷ "} {tools().length} toolcalls · {Locale.duration(duration())} @@ -2212,10 +2212,16 @@ function Diagnostics(props: { diagnostics?: Record[] function normalizePath(input?: string) { if (!input) return "" - if (path.isAbsolute(input)) { - return path.relative(process.cwd(), input) || "." - } - return input + + const cwd = process.cwd() + const absolute = path.isAbsolute(input) ? input : path.resolve(cwd, input) + const relative = path.relative(cwd, absolute) + + if (!relative) return "." + if (!relative.startsWith("..")) return relative + + // outside cwd - use absolute + return absolute } function input(input: Record, omit?: string[]): string {