File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
mpp-ui/src/jsMain/typescript/agents Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,9 @@ export class CliRenderer {
121121 // Find what's new since last output
122122 const newContent = processedContent . slice ( this . lastOutputLength || 0 ) ;
123123 if ( newContent . length > 0 ) {
124- process . stdout . write ( chalk . white ( newContent ) ) ;
124+ // Clean up excessive newlines - replace multiple consecutive newlines with at most 2
125+ const cleanedContent = newContent . replace ( / \n { 3 , } / g, '\n\n' ) ;
126+ process . stdout . write ( chalk . white ( cleanedContent ) ) ;
125127 this . lastOutputLength = processedContent . length ;
126128 }
127129 }
@@ -186,7 +188,12 @@ export class CliRenderer {
186188 }
187189
188190 this . lastIterationReasoning = currentReasoning ;
189- console . log ( ) ; // Single line break after reasoning
191+
192+ // Only add a line break if the content doesn't already end with one
193+ const trimmedContent = finalContent . trimEnd ( ) ;
194+ if ( trimmedContent . length > 0 && ! trimmedContent . endsWith ( '\n' ) ) {
195+ console . log ( ) ; // Single line break after reasoning only if needed
196+ }
190197 }
191198
192199 private calculateSimilarity ( str1 : string , str2 : string ) : number {
You can’t perform that action at this time.
0 commit comments