Don't print prelude in terminal mode (#3890)
We can't correctly print simple messages for prelude events when doing progress based display in a terminal, as it would lead to resetting the display of the table rendering. This does mean that `--show-config` no longer works in the default terminal display mode - but it's not clear it *can* work correctly (at least as currently implemented) since it doesn't cleanly participate in the table rendering. For cases where `--show-config` is not set (the norm) -nothing would have been printed anyway, so the changes here just avoid resetting the table rendering unnecessarily. Fixes #3469.
This commit is contained in:
parent
060450395c
commit
f6e37c25ad
|
@ -2,6 +2,9 @@ CHANGELOG
|
|||
=========
|
||||
|
||||
## HEAD (unreleased)
|
||||
- Avoid duplicated messages in preview/update progress display.
|
||||
[#3890](https://github.com/pulumi/pulumi/pull/3890)
|
||||
|
||||
- Improve CPU utilization in the Python SDK when waiting for resource operations.
|
||||
[#3892](https://github.com/pulumi/pulumi/pull/3892)
|
||||
|
||||
|
|
|
@ -855,9 +855,21 @@ func (display *ProgressDisplay) processNormalEvent(event engine.Event) {
|
|||
// A prelude event can just be printed out directly to the console.
|
||||
// Note: we should probably make sure we don't get any prelude events
|
||||
// once we start hearing about actual resource events.
|
||||
|
||||
payload := event.Payload.(engine.PreludeEventPayload)
|
||||
display.writeSimpleMessage(renderPreludeEvent(payload, display.opts))
|
||||
preludeEventString := renderPreludeEvent(payload, display.opts)
|
||||
if display.isTerminal {
|
||||
display.processNormalEvent(engine.Event{
|
||||
Type: engine.DiagEvent,
|
||||
Payload: engine.DiagEventPayload{
|
||||
Ephemeral: false,
|
||||
Severity: diag.Info,
|
||||
Color: cmdutil.GetGlobalColorization(),
|
||||
Message: preludeEventString,
|
||||
},
|
||||
})
|
||||
} else {
|
||||
display.writeSimpleMessage(preludeEventString)
|
||||
}
|
||||
return
|
||||
case engine.SummaryEvent:
|
||||
// keep track of the summar event so that we can display it after all other
|
||||
|
|
Loading…
Reference in a new issue