Skip to content

Commit d5c3e40

Browse files
betegonclaude
andcommitted
fix(project): use renderTextTable for TTY platform grids
Replace raw markdown table syntax with renderTextTable for terminal output so users see box-drawn borders instead of raw pipe characters. Fall back to buildMarkdownTable for plain/piped output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6bbc30c commit d5c3e40

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/commands/project/create.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ import {
3131
withAuthGuard,
3232
} from "../../lib/errors.js";
3333
import { formatProjectCreated, writeJson } from "../../lib/formatters/index.js";
34+
import { isPlainOutput } from "../../lib/formatters/markdown.js";
3435
import { buildMarkdownTable, type Column } from "../../lib/formatters/table.js";
36+
import { renderTextTable } from "../../lib/formatters/text-table.js";
3537
import {
3638
COMMON_PLATFORMS,
3739
isValidPlatform,
@@ -76,11 +78,21 @@ function platformGrid(items: readonly string[]): string {
7678
}
7779
rows.push(row);
7880
}
79-
const columns: Column<string[]>[] = Array.from({ length: COLS }, (_, ci) => ({
80-
header: " ",
81-
value: (row: string[]) => row[ci] ?? "",
82-
}));
83-
return buildMarkdownTable(rows, columns);
81+
82+
if (isPlainOutput()) {
83+
const columns: Column<string[]>[] = Array.from(
84+
{ length: COLS },
85+
(_, ci) => ({
86+
header: " ",
87+
value: (row: string[]) => row[ci] ?? "",
88+
})
89+
);
90+
return buildMarkdownTable(rows, columns);
91+
}
92+
93+
return renderTextTable(new Array(COLS).fill(""), rows, {
94+
headerSeparator: false,
95+
});
8496
}
8597

8698
function normalizePlatform(platform: string, stderr: Writer): string {

0 commit comments

Comments
 (0)