Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
| ... | ... |
@@ -131,7 +131,7 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, |
| 131 | 131 |
if jm.Progress != nil {
|
| 132 | 132 |
jm.Progress.terminalFd = terminalFd |
| 133 | 133 |
} |
| 134 |
- if jm.Progress != nil || jm.ProgressMessage != "" {
|
|
| 134 |
+ if jm.ID != "" && (jm.Progress != nil || jm.ProgressMessage != "") {
|
|
| 135 | 135 |
line, ok := ids[jm.ID] |
| 136 | 136 |
if !ok {
|
| 137 | 137 |
line = len(ids) |
| ... | ... |
@@ -141,17 +141,15 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, |
| 141 | 141 |
} else {
|
| 142 | 142 |
diff = len(ids) - line |
| 143 | 143 |
} |
| 144 |
- if isTerminal {
|
|
| 144 |
+ if jm.ID != "" && isTerminal {
|
|
| 145 | 145 |
// <ESC>[{diff}A = move cursor up diff rows
|
| 146 | 146 |
fmt.Fprintf(out, "%c[%dA", 27, diff) |
| 147 | 147 |
} |
| 148 | 148 |
} |
| 149 | 149 |
err := jm.Display(out, isTerminal) |
| 150 |
- if jm.ID != "" {
|
|
| 151 |
- if isTerminal {
|
|
| 152 |
- // <ESC>[{diff}B = move cursor down diff rows
|
|
| 153 |
- fmt.Fprintf(out, "%c[%dB", 27, diff) |
|
| 154 |
- } |
|
| 150 |
+ if jm.ID != "" && isTerminal {
|
|
| 151 |
+ // <ESC>[{diff}B = move cursor down diff rows
|
|
| 152 |
+ fmt.Fprintf(out, "%c[%dB", 27, diff) |
|
| 155 | 153 |
} |
| 156 | 154 |
if err != nil {
|
| 157 | 155 |
return err |