Skip to content

Commit 54a3037

Browse files
JhonnyBillMaciidgh
authored andcommitted
[SR-8993] - Progress bar update crash when running tests in Xcode (#1814)
* TerminalWidth defaults to 80 if it's nil or zero * Reestructure TerminalWidth validation
1 parent 00e8771 commit 54a3037

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/Basic/TerminalController.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ public final class TerminalController {
7979
return nil
8080
}
8181

82-
width = TerminalController.terminalWidth() ?? 80 // Assume default if we are not able to determine.
82+
// Determine the terminal width otherwise assume a default.
83+
if let terminalWidth = TerminalController.terminalWidth(), terminalWidth > 0 {
84+
width = terminalWidth
85+
} else {
86+
width = 80
87+
}
8388
self.stream = stream
8489
}
8590

0 commit comments

Comments
 (0)