Avoid erasing line for non-progress messages
The JSONMessage.Display methods erases the entire line by outputting the <ESC>[2K\r sequence before displaying the message content. This is not necessary for messages other than progress indicators, and introduces unwanted characters in the /events output. Fixes #6203. Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <icecrime@gmail.com> (github: icecrime)
This commit is contained in:
parent
52edbe6a23
commit
3807f8b708
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error {
|
|||
return jm.Error
|
||||
}
|
||||
var endl string
|
||||
if isTerminal && jm.Stream == "" {
|
||||
if isTerminal && jm.Stream == "" && jm.Progress != nil {
|
||||
// <ESC>[2K = erase entire current line
|
||||
fmt.Fprintf(out, "%c[2K\r", 27)
|
||||
endl = "\r"
|
||||
|
|
Loading…
Add table
Reference in a new issue