Skip to content

Bug: Table column width calculation includes ANSI escape code characters #8

@404-Page-Found

Description

@404-Page-Found

Description

In \src/utils/logger.ts:34:

\\ s
colWidths[i] = Math.max(colWidths[i] ?? 0, row[i].length)
\\

The column width is computed using
ow[i].length, which counts all characters including ANSI escape codes injected by \chalk. For example, \chalk.green('merged')\ produces the string \\x1b[32mmerged\x1b[39m\ with length 19, but a visible length of only 6.

Impact

In \�ranches.ts, status labels like \chalk.green('merged'), \chalk.yellow('stale'), \chalk.blue('active'), and \chalk.red('protected')\ are passed as table cells. The column width is inflated by the invisible escape sequences, causing table columns to be much wider than the visible text, resulting in misaligned, poorly formatted output.

Suggested Fix

Use a library like \string-width\ or strip ANSI codes before computing column widths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions