diff --git a/packages/coding-agent/example.txt b/packages/coding-agent/example.txt index 435c1104..f28736ef 100644 --- a/packages/coding-agent/example.txt +++ b/packages/coding-agent/example.txt @@ -1,4 +1,30 @@ -Hello, World! -This line has been edited! -This is line three. -Goodbye, World! \ No newline at end of file +The Quick Brown Fox and the Lazy Dog +===================================== + +Once upon a time, in a forest clearing, there lived a remarkably quick brown fox. +This fox was known throughout the woodland for its incredible speed and agility. + +Every morning, the fox would race through the trees, leaping over logs and streams. +The other animals watched in awe as it darted past them in a blur of russet fur. + +Near the edge of the clearing, there also lived a very lazy dog. +This dog preferred napping in the warm sunshine to any sort of adventure. + +One day, the fox challenged the dog to a race across the meadow. +The dog yawned and declined, saying "Why rush when you can rest?" + +The fox laughed and zipped away, exploring distant hills and valleys. +The dog simply rolled over and continued its peaceful slumber. + +As the sun set, the fox returned, exhausted from its day of running. +The dog opened one eye and wagged its tail contentedly. + +"I've seen the whole world today!" exclaimed the tired fox proudly. +"And I've enjoyed every moment right here," replied the lazy dog. + +Sometimes speed and adventure bring joy to life's journey. +Other times, stillness and contentment are the greatest treasures. + +Both the quick fox and the lazy dog lived happily in their own ways. + +The End. diff --git a/packages/coding-agent/src/tui/tool-execution.ts b/packages/coding-agent/src/tui/tool-execution.ts index 96e9c43a..6c4dc9d8 100644 --- a/packages/coding-agent/src/tui/tool-execution.ts +++ b/packages/coding-agent/src/tui/tool-execution.ts @@ -64,15 +64,14 @@ export class ToolExecutionComponent extends Container { text = `**read** \`${path}\``; if (this.result) { const lines = this.result.output.split("\n"); - const maxLines = 5; + const maxLines = 10; const displayLines = lines.slice(0, maxLines); const remaining = lines.length - maxLines; - text += "\n```\n" + displayLines.join("\n"); + text += "\n" + displayLines.join("\n"); if (remaining > 0) { text += `\n... (${remaining} more lines)`; } - text += "\n```"; if (this.result.isError) { text += " ❌"; @@ -82,8 +81,12 @@ export class ToolExecutionComponent extends Container { const path = this.args.path || ""; const content = this.args.content || ""; const lines = content.split("\n"); - text = `**write** \`${path}\` (${lines.length} lines)`; + text = `**write** \`${path}\``; if (this.result) { + const totalLines = lines.length; + if (totalLines > 10) { + text += ` (${totalLines} lines)`; + } text += this.result.isError ? " ❌" : " ✓"; } } else if (this.toolName === "edit") { diff --git a/packages/test.txt b/packages/test.txt new file mode 100644 index 00000000..aaae145f --- /dev/null +++ b/packages/test.txt @@ -0,0 +1,20 @@ +Line 1: The quick brown fox jumps over the lazy dog +Line 2: Testing the TUI renderer with multiple lines +Line 3: Each line contains some different text +Line 4: This is line number four +Line 5: Halfway through the first ten lines +Line 6: More content for testing purposes +Line 7: Seven is a lucky number +Line 8: Eight lines down, twelve to go +Line 9: Almost at line ten +Line 10: Double digits now +Line 11: Starting the second half +Line 12: A dozen lines complete +Line 13: Unlucky for some, lucky for others +Line 14: Fortnight means fourteen nights +Line 15: Three quarters of the way there +Line 16: Sweet sixteen +Line 17: Just a few more lines left +Line 18: Penultimate line coming up +Line 19: This is the second to last line +Line 20: The final line of this test file