@@ -383,7 +383,6 @@ async function handleCustomCommand(name: string, args: string) {
383383 const startTime = Date . now ( )
384384 isOperationInProgress = true
385385 let lastChunkWasToolStart = false
386- let lastToolSummary = ""
387386 let lastChunkType : string | null = null
388387 let lastToolName = ""
389388 let lastToolArg = ""
@@ -445,7 +444,6 @@ async function handleCustomCommand(name: string, args: string) {
445444 write ( `${ display } \n` )
446445 }
447446
448- lastToolSummary = arg
449447 lastChunkWasToolStart = true
450448 lastChunkType = "tool"
451449 }
@@ -454,15 +452,14 @@ async function handleCustomCommand(name: string, args: string) {
454452 const tool = chunk . tool . trim ( )
455453 const arg = summarizeInput ( tool , chunk . input )
456454 const cols = process . stdout . columns || 80
455+ const summary = arg ? ` ${ arg } ` : ""
456+ const line = `${ fg . green } ✓${ style . reset } ${ fg . cyan } ${ tool } ${ style . reset } ${ fg . gray } ${ summary } ${ style . reset } `
457+ const display = line . length > cols ? line . slice ( 0 , cols - 1 ) + "…" : line
457458
458- if ( lastChunkWasToolStart && lastToolSummary === arg ) {
459- const count = repeatCount + 1
460- const countText = count > 1 ? ` (×${ count } )` : ""
461- const line = `${ fg . green } ✓${ style . reset } ${ fg . cyan } ${ tool } ${ style . reset } ${ fg . gray } ${ arg ? ` ${ arg } ` : "" } ${ countText } ${ style . reset } `
462- const display = line . length > cols ? line . slice ( 0 , cols - 1 ) + "…" : line
459+ if ( lastChunkType === "tool" ) {
463460 write ( `\x1b[1A\r\x1b[2K${ display } \n` )
464461 } else {
465- write ( `${ fg . green } ✓ ${ style . reset } ${ fg . cyan } ${ tool } ${ style . reset } \n` )
462+ write ( `${ display } \n` )
466463 }
467464
468465 lastChunkWasToolStart = false
@@ -509,7 +506,6 @@ async function handleMessage(message: string) {
509506 const startTime = Date . now ( )
510507 isOperationInProgress = true
511508 let lastChunkWasToolStart = false
512- let lastToolSummary = ""
513509 let lastChunkType : string | null = null
514510 let lastToolName = ""
515511 let lastToolArg = ""
@@ -571,7 +567,6 @@ async function handleMessage(message: string) {
571567 write ( `${ display } \n` )
572568 }
573569
574- lastToolSummary = arg
575570 lastChunkWasToolStart = true
576571 lastChunkType = "tool"
577572 }
@@ -580,15 +575,14 @@ async function handleMessage(message: string) {
580575 const tool = chunk . tool . trim ( )
581576 const arg = summarizeInput ( tool , chunk . input )
582577 const cols = process . stdout . columns || 80
578+ const summary = arg ? ` ${ arg } ` : ""
579+ const line = `${ fg . green } ✓${ style . reset } ${ fg . cyan } ${ tool } ${ style . reset } ${ fg . gray } ${ summary } ${ style . reset } `
580+ const display = line . length > cols ? line . slice ( 0 , cols - 1 ) + "…" : line
583581
584- if ( lastChunkWasToolStart && lastToolSummary === arg ) {
585- const count = repeatCount + 1
586- const countText = count > 1 ? ` (×${ count } )` : ""
587- const line = `${ fg . green } ✓${ style . reset } ${ fg . cyan } ${ tool } ${ style . reset } ${ fg . gray } ${ arg ? ` ${ arg } ` : "" } ${ countText } ${ style . reset } `
588- const display = line . length > cols ? line . slice ( 0 , cols - 1 ) + "…" : line
582+ if ( lastChunkType === "tool" ) {
589583 write ( `\x1b[1A\r\x1b[2K${ display } \n` )
590584 } else {
591- write ( `${ fg . green } ✓ ${ style . reset } ${ fg . cyan } ${ tool } ${ style . reset } \n` )
585+ write ( `${ display } \n` )
592586 }
593587
594588 lastChunkWasToolStart = false
0 commit comments