fix: TUI overflow, scrollable header, tool output, git branch

- Fixed: chat content no longer overflows past allocated height.
  Lines are measured for physical width and hard-truncated to
  exactly the chat area height. Input + status bar always visible.
- Header scrolls with chat (not pinned), only input/status fixed
- Git branch in status bar (green, via git rev-parse)
- Alt screen mode — terminal scrollback disabled
- Mouse wheel + PgUp/PgDown scroll within TUI
- New EventToolResult: tool output as dimmed indented block
- Separator lines above/below input, no status bar backgrounds
This commit is contained in:
2026-04-03 15:53:42 +02:00
parent 02da40e6b9
commit 6c70a2ceaf
5 changed files with 326 additions and 148 deletions

View File

@@ -218,11 +218,12 @@ func (e *Engine) executeTools(ctx context.Context, calls []message.ToolCall, cb
output = e.cfg.Firewall.ScanToolResult(output)
}
// Emit tool result as a text delta event so the UI can show it
// Emit tool result event for the UI
if cb != nil {
cb(stream.Event{
Type: stream.EventTextDelta,
Text: fmt.Sprintf("\n[tool:%s] %s\n", call.Name, truncate(output, 500)),
Type: stream.EventToolResult,
ToolName: call.Name,
ToolOutput: truncate(output, 2000),
})
}