Skip to content

Commit c8152ed

Browse files
authored
Merge pull request cli#11879 from cli/kw/fix-progress-indicator-for-create-follow
`gh agent-task create`: Fix `--follow` not killing the progress indicator
2 parents 67bf27b + 91c6bc6 commit c8152ed

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/cmd/agent-task/create/create.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ func createRun(opts *CreateOptions) error {
166166
}
167167

168168
if opts.Follow {
169+
opts.IO.StopProgressIndicator()
170+
fmt.Fprintf(opts.IO.Out, "Displaying session logs for job %s. Press Ctrl+C to stop.\n", job.ID)
169171
return followLogs(opts, client, job.SessionID)
170172
}
171173

pkg/cmd/agent-task/create/create_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ func Test_createRun(t *testing.T) {
488488
}
489489
},
490490
wantStdout: heredoc.Doc(`
491+
Displaying session logs for job job123. Press Ctrl+C to stop.
491492
(rendered:) <raw-logs-one>
492493
(rendered:) <raw-logs-two>
493494
`),

0 commit comments

Comments
 (0)