From 00c17ba00c713daea531ae7dd159eac230adae18 Mon Sep 17 00:00:00 2001 From: Rahul Bansal Date: Sat, 21 Feb 2026 18:37:44 +0530 Subject: [PATCH] fix: show model name, message count, session key in TUI status bar --- pkg/tui/model.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/tui/model.go b/pkg/tui/model.go index 8be332e92..3db627ea1 100644 --- a/pkg/tui/model.go +++ b/pkg/tui/model.go @@ -441,15 +441,23 @@ func (m Model) renderHeader() string { // renderStatusBar returns the status bar at the bottom func (m Model) renderStatusBar() string { - left := "Ctrl+C: quit | PgUp/PgDn: scroll | Alt+Enter: newline" - pct := fmt.Sprintf("%3.0f%%", m.viewport.ScrollPercent()*100) + left := m.modelName - gap := m.width - lipgloss.Width(left) - lipgloss.Width(pct) - 2 // padding + // Count user and assistant messages + msgCount := 0 + for _, msg := range m.messages { + if msg.role == "user" || msg.role == "assistant" { + msgCount++ + } + } + right := fmt.Sprintf("messages: %d | session: %s", msgCount, truncateSessionKey(m.sessionKey)) + + gap := m.width - lipgloss.Width(left) - lipgloss.Width(right) - 2 // padding if gap < 1 { gap = 1 } - bar := left + strings.Repeat(" ", gap) + pct + bar := left + strings.Repeat(" ", gap) + right return statusBarStyle.Render(bar) }