Fix bash tool visual line truncation

Use visual line counting (accounting for line wrapping) instead of logical
line counting for bash tool output in collapsed mode. Now consistent with
bash-execution.ts behavior.

- Add shared truncateToVisualLines utility
- Update tool-execution.ts to use Box for bash with visual truncation
- Update bash-execution.ts to use shared utility
- Pass TUI to ToolExecutionComponent for terminal width access

Fixes #275
This commit is contained in:
Mario Zechner 2025-12-22 17:01:04 +01:00
parent 31f4a588fd
commit 7ad8a8c447
5 changed files with 163 additions and 58 deletions

View file

@ -815,6 +815,7 @@ export class InteractiveMode {
showImages: this.settingsManager.getShowImages(),
},
this.customTools.get(content.name)?.tool,
this.ui,
);
this.chatContainer.addChild(component);
this.pendingTools.set(content.id, component);
@ -862,6 +863,7 @@ export class InteractiveMode {
showImages: this.settingsManager.getShowImages(),
},
this.customTools.get(event.toolName)?.tool,
this.ui,
);
this.chatContainer.addChild(component);
this.pendingTools.set(event.toolCallId, component);
@ -1101,6 +1103,7 @@ export class InteractiveMode {
showImages: this.settingsManager.getShowImages(),
},
this.customTools.get(content.name)?.tool,
this.ui,
);
this.chatContainer.addChild(component);