Skip to content

Commit 2fae270

Browse files
committed
bot comments
1 parent a7192f3 commit 2fae270

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

cmd/browsers.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,9 @@ func (b BrowsersCmd) LiveView(ctx context.Context, in BrowsersViewInput) error {
503503
return util.CleanedUpSdkError{Err: err}
504504
}
505505

506-
// Set default interval if not specified
506+
// Set default interval if not specified or invalid
507507
interval := in.Interval
508-
if interval == 0 {
508+
if interval <= 0 {
509509
interval = 100 * time.Millisecond
510510
}
511511

@@ -828,8 +828,13 @@ func (b BrowsersCmd) ComputerScreenshot(ctx context.Context, in BrowsersComputer
828828
// Display inline in terminal if requested
829829
if in.Display {
830830
if err := termimg.DisplayImage(os.Stdout, imgData); err != nil {
831-
pterm.Error.Printf("Failed to display screenshot: %v\n", err)
832-
return nil
831+
// If --to was also specified, warn but continue to save the file
832+
if in.To != "" {
833+
pterm.Warning.Printf("Failed to display screenshot: %v\n", err)
834+
} else {
835+
pterm.Error.Printf("Failed to display screenshot: %v\n", err)
836+
return nil
837+
}
833838
}
834839
}
835840

0 commit comments

Comments
 (0)