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:
parent
fca5e0cd63
commit
2a99dcd2ce
1 changed files with 6 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue