Add pager support to agent-task list output

Introduces pager functionality to the agent-task list command output for improved readability. If the pager fails to start, an error message is printed to stderr. Aligns with implementations in other commands.
This commit is contained in:
Kynan Ware 2025-09-02 17:13:43 -06:00
parent fca5e0cd63
commit 2a99dcd2ce

View file

@ -133,6 +133,12 @@ func listRun(opts *ListOptions) error {
return cmdutil.NewNoResultsError("no agent tasks found")
}
if err := opts.IO.StartPager(); err == nil {
defer opts.IO.StopPager()
} else {
fmt.Fprintf(opts.IO.ErrOut, "error starting pager: %v\n", err)
}
cs := opts.IO.ColorScheme()
tp := tableprinter.New(opts.IO, tableprinter.WithHeader("Session ID", "Pull Request", "Repo", "Session State", "Created"))
for _, s := range sessions {