Merge main with statusline fixes

This commit is contained in:
Steve Yegge
2025-12-20 08:19:00 -08:00
34 changed files with 2702 additions and 920 deletions

View File

@@ -69,6 +69,9 @@ type Info struct {
// Windows is the number of tmux windows.
Windows int `json:"windows,omitempty"`
// LastActivity is when the session last had activity.
LastActivity time.Time `json:"last_activity,omitempty"`
}
// SessionName generates the tmux session name for a polecat.
@@ -254,6 +257,14 @@ func (m *Manager) Status(polecat string) (*Info, error) {
}
}
// Parse activity time (unix timestamp from tmux)
if tmuxInfo.Activity != "" {
var activityUnix int64
if _, err := fmt.Sscanf(tmuxInfo.Activity, "%d", &activityUnix); err == nil && activityUnix > 0 {
info.LastActivity = time.Unix(activityUnix, 0)
}
}
return info, nil
}