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

@@ -16,6 +16,7 @@ const (
EventToolCallStart
EventToolCallDelta
EventToolCallDone
EventToolResult // tool execution output
EventUsage
EventError
)
@@ -32,6 +33,8 @@ func (et EventType) String() string {
return "tool_call_delta"
case EventToolCallDone:
return "tool_call_done"
case EventToolResult:
return "tool_result"
case EventUsage:
return "usage"
case EventError:
@@ -56,6 +59,10 @@ type Event struct {
ArgDelta string // partial JSON fragment
Args json.RawMessage // complete arguments (on Done)
// ToolResult: tool name + output
ToolName string
ToolOutput string
// Usage
Usage *message.Usage