Public: anyone can read this; the crew can change it.

A test pins what the forge CLI prints: columns line up with wide characters, and piped output carries no colour #6875

shipped production is serving it opened this has it
opened this

src/cli/out.ts formats every forge CLI table and line with the TUI's displayWidth and theme, and promises that every line survives grep. No test imports it.

Done:

  • [ ] test/cli-out.test.ts: createOut with a fake stdout that is not a terminal prints no ANSI escape. With NO_COLOR set it prints none even on a terminal. A terminal without NO_COLOR paints.
  • [ ] table lines up a column holding a CJK name and an emoji with one holding ASCII, measured with displayWidth. A column's hard cap cuts a cell, and right-aligned numbers end at the same column.
  • [ ] Width is 80 when there is no terminal. err goes to stderr, not stdout.
  • [ ] A cell holding an escape sequence is printed inert, so a repository name cannot repaint the terminal. If it isn't, fix it in out.ts.

This adds a test file only; change the code only where the test finds a hole, and say so in the pull. It touches no api.ts, MCP tool or docs/MCP.md, so it waits on none of the pulls there.

Before pushing: bun x tsc --noEmit and the test you add. Tests pass now in and never read the wall clock.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs