From 2804d85f17c21ac5cf0824fff2764196bee05d20 Mon Sep 17 00:00:00 2001 From: Reuven Date: Fri, 8 May 2026 10:12:11 -0400 Subject: [PATCH] fix(3.7.0-alpha.14): auto-compact statusline on narrow terminals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1153. `ruflo hooks statusline` outputs 5+ lines of full-width formatted content by default. On narrow terminals (≤80 cols, common in tmux splits and side-by-side layouts) the lines wrap awkwardly and consume 6-7 lines of vertical space. Fix: `commands/hooks.ts` statusline now reads `process.stdout.columns` and auto-collapses to the existing single-line `compact` format when the terminal is narrower than 100 cols. New `--full` flag overrides this auto-detection for users who prefer the multi-line output even on narrow terms. `--compact` and `--json` continue to work as explicit overrides; default behavior on wide terminals is unchanged. Verification (this repo, both modes): COLUMNS=80 statusline (no flag) → "DDD:3/5 CVE:0/3 Swarm:1/15 Ctx:50% Int:10%" COLUMNS=80 statusline --full → 5-line multi-line output preserved COLUMNS=200 statusline (no flag) → 5-line multi-line (auto-detected wide) Build clean. Published @claude-flow/cli@3.7.0-alpha.14, claude-flow@3.7.0-alpha.14, ruflo@3.7.0-alpha.14 with all dist-tags. Co-Authored-By: RuFlo --- package.json | 2 +- ruflo/package.json | 2 +- v3/@claude-flow/cli/package.json | 2 +- v3/@claude-flow/cli/src/commands/hooks.ts | 20 +++++++++++++++++--- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 100ce1cfd7..dcdbc49eda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claude-flow", - "version": "3.7.0-alpha.13", + "version": "3.7.0-alpha.14", "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration", "main": "dist/index.js", "type": "module", diff --git a/ruflo/package.json b/ruflo/package.json index de3ed9178a..f0ac9f342f 100644 --- a/ruflo/package.json +++ b/ruflo/package.json @@ -1,6 +1,6 @@ { "name": "ruflo", - "version": "3.7.0-alpha.13", + "version": "3.7.0-alpha.14", "description": "Ruflo - Enterprise AI agent orchestration platform. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration", "main": "bin/ruflo.js", "type": "module", diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json index 37e8026216..e7eacc302e 100644 --- a/v3/@claude-flow/cli/package.json +++ b/v3/@claude-flow/cli/package.json @@ -1,6 +1,6 @@ { "name": "@claude-flow/cli", - "version": "3.7.0-alpha.13", + "version": "3.7.0-alpha.14", "type": "module", "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code", "main": "dist/src/index.js", diff --git a/v3/@claude-flow/cli/src/commands/hooks.ts b/v3/@claude-flow/cli/src/commands/hooks.ts index 093a660b19..7921f8dfcd 100644 --- a/v3/@claude-flow/cli/src/commands/hooks.ts +++ b/v3/@claude-flow/cli/src/commands/hooks.ts @@ -4013,7 +4013,13 @@ const statuslineCommand: Command = { }, { name: 'compact', - description: 'Compact single-line output', + description: 'Compact single-line output (auto-enabled when terminal width < 100 cols)', + type: 'boolean', + default: false + }, + { + name: 'full', + description: 'Force the full multi-line output even on narrow terminals', type: 'boolean', default: false }, @@ -4252,8 +4258,16 @@ const statuslineCommand: Command = { return { success: true, data: statusData }; } - // Compact output - if (ctx.flags.compact) { + // #1153: auto-collapse to compact on narrow terminals so the full + // 6+ line statusline doesn't dominate the screen. Honors: + // - explicit --compact → compact + // - explicit --full → full (overrides auto-detection) + // - else → compact when terminal < 100 cols (full multi-line + // output expects ~100 cols of horizontal space) + const COMPACT_WIDTH_THRESHOLD = 100; + const terminalCols = process.stdout.columns ?? 80; + const autoCompact = !ctx.flags.full && terminalCols < COMPACT_WIDTH_THRESHOLD; + if (ctx.flags.compact || autoCompact) { const line = `DDD:${progress.domainsCompleted}/${progress.totalDomains} CVE:${security.cvesFixed}/${security.totalCves} Swarm:${swarm.activeAgents}/${swarm.maxAgents} Ctx:${system.contextPct}% Int:${system.intelligencePct}%`; output.writeln(line); return { success: true, data: statusData };