Assume no terminal if the display width/height is 0 (#5959)

This commit is contained in:
Lee Zen 2020-12-18 15:38:15 -08:00 committed by GitHub
parent 1c87d58b4a
commit 518ec3a8a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -16,6 +16,9 @@ CHANGELOG
- Fix a bug in the core engine where ComponentResource state would be accessed before initialization.
[#5949](https://github.com/pulumi/pulumi/pull/5949)
- Prevent a panic by not attempting to show progress for zero width/height terminals.
[#5957](https://github.com/pulumi/pulumi/issues/5957)
## 2.15.6 (2020-12-12)
- Fix a bug in the Go SDK that could result in dropped resource dependencies.

View file

@ -327,6 +327,13 @@ func ShowProgressEvents(op string, action apitype.UpdateKind, stack tokens.QName
display.terminalWidth = terminalWidth
display.terminalHeight = terminalHeight
// Don't bother attempting to treat this display as a terminal if it has no width/height.
if display.isTerminal && (display.terminalWidth == 0 || display.terminalHeight == 0) {
display.isTerminal = false
_, err = fmt.Fprintln(stderr, "Treating display as non-terminal due to 0 width/height.")
contract.IgnoreError(err)
}
// Fetch the canonical stdout stream, configured appropriately.
_, stdout, _ = term.StdStreams()
}