Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions apps/cli/src/divider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@ const SHOW_CURSOR = '\x1b[?25h';
* @param text - The label to display.
*/
export function runDivider(text: string): void {
// Terminal size, falling back to COLUMNS/LINES env then a default — the env
// fallback lets a non-TTY (piped) run render at an explicit size for preview.
const dims = (): [number, number] => [
process.stdout.columns || Number(process.env.COLUMNS) || 80,
process.stdout.rows || Number(process.env.LINES) || 24,
];
const paint = (): void => {
const cols = process.stdout.columns || 80;
const rows = process.stdout.rows || 24;
const [cols, rows] = dims();
process.stdout.write(CLEAR + renderBanner(text, cols, rows));
};

// Non-interactive (piped) stdout: emit once and return, no hold.
if (!process.stdout.isTTY) {
process.stdout.write(renderBanner(text, process.stdout.columns || 80, process.stdout.rows || 24) + '\n');
const [cols, rows] = dims();
process.stdout.write(renderBanner(text, cols, rows) + '\n');
return;
}

Expand Down
4 changes: 4 additions & 0 deletions docs/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

What each release brought. Reverse-chronological. Dates reflect when the corresponding tag was pushed.

## 3.6.1 — 2026-07-09

**`mx divider` renders much larger.** The banner now scales to fill the terminal (chunky letters at the largest cell size the width allows, height grown to match) instead of strict proportional scaling, which left a long label like `IN REVIEWS` tiny on a fullscreen window (7 rows). Also honors `COLUMNS`/`LINES` env vars as a size fallback for non-TTY (piped) output, so you can preview a size without going fullscreen. Renderer-only change in `@mx/core` (`renderBanner`) plus the CLI size fallback.

## 3.6.0 — 2026-07-08

**`mx divider <text> [-o]`** — fill a terminal with `<text>` as large block letters, a visual separator for macOS Mission Control Spaces (e.g. an `IN REVIEWS` / `PR REVIEWS` window between clusters of work windows). Bare, it takes over the current terminal, draws the banner, and holds it (Ctrl-C or `q` to quit); `-o` opens a new fullscreen Terminal running the same banner (macOS). The text auto-scales to fill the terminal and re-renders on resize.
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roulabs/mx",
"version": "3.6.0",
"version": "3.6.1",
"description": "mx — run several features in parallel across shared repos using git worktrees",
"type": "module",
"bin": {
Expand Down
14 changes: 8 additions & 6 deletions packages/core/src/banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@ export function renderBanner(text: string, cols: number, rows: number): string {
baseRows.push(glyphs.map((g) => g[r]).join(' '));
}

// Pick a scale that fits both dimensions. A character cell is about twice as
// tall as wide, so we aim for xscale ≈ 2·yscale to keep letters looking
// square, but never exceed the width/height budget (each axis is clamped
// independently, so long text scales down instead of overflowing).
// Scale up to fill the terminal. Width is the usual constraint (a long label
// caps how wide each cell can be), so take the largest cell width that fits
// and then grow the height to match — capped at the same factor so letters
// stay chunky (roughly square in cell counts) rather than proportional-but-
// tiny. This fills far more of a large fullscreen window than strict
// proportional scaling, which is what makes the banner readable at a glance.
const marginH = 2;
const marginV = 2;
const xMax = Math.floor((cols - marginH) / Math.max(1, baseW));
const yMax = Math.floor((rows - marginV) / GLYPH_H);
const yscale = Math.max(1, Math.min(yMax, Math.floor(xMax / 2)));
const xscale = Math.max(1, Math.min(xMax, yscale * 2));
const xscale = Math.max(1, xMax);
const yscale = Math.max(1, Math.min(yMax, xscale));

// Scale each base row up (horizontally by xscale, vertically by yscale).
const scaled: string[] = [];
Expand Down
Loading