Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(cli-core): fit truncation markers in narrow columns

Rudy Celekli2d778877f687
diff --git a/tests/output-narrow-columns.test.mjs b/tests/output-narrow-columns.test.mjs
new file mode 100644
index 0000000000..50c0eef02a
--- /dev/null
+++ b/tests/output-narrow-columns.test.mjs
@@ -0,0 +1,11 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { OutputFormatter } from '../v3/@claude-flow/cli-core/src/output.ts';
+test('one to three character columns never overflow their border', () => {
+ const f = new OutputFormatter({ color: false });
+ for (const width of [1, 2, 3, 4]) {
+ const lines = f.table({ columns: [{ key: 'value', header: 'Header', width }], data: [{ value: 'Longer content' }] }).split('\n');
+ for (const line of lines) assert.equal(line.length, lines[0].length);
+ assert.equal(lines[0].length, width + 4);
+ }
+});
diff --git a/v3/@claude-flow/cli-core/src/output.ts b/v3/@claude-flow/cli-core/src/output.ts
index 9052a53923..034e4ae96c 100644
--- a/v3/@claude-flow/cli-core/src/output.ts
+++ b/v3/@claude-flow/cli-core/src/output.ts
@@ -370,6 +370,7 @@ export class OutputFormatter {
private truncate(text: string, maxLength: number): string {
const stripped = this.stripAnsi(text);
if (stripped.length <= maxLength) return text;
+ if (maxLength <= 3) return '.'.repeat(Math.max(0, maxLength));
return stripped.slice(0, maxLength - 3) + '...';
}