Skip to content

Commit

Permalink
Merge pull request #5 from rsese/rsese-4-dont-crash-not-a-terminal
Browse files Browse the repository at this point in the history
default to 80 term width if not a terminal
  • Loading branch information
rsese committed Jan 5, 2023
2 parents 5f5eb03 + d785f9e commit b165213
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func truncateWorkflowName(name string, length int) string {
}

func getTerminalWidth() int {
if !term.IsTerminal(int(os.Stdout.Fd())) {
return 80
}

width, _, err := term.GetSize(int(os.Stdout.Fd()))

if err != nil {
Expand Down

0 comments on commit b165213

Please sign in to comment.