Skip to content

Commit d88f413

Browse files
Strip extra escape codes on empty lines
Signed-off-by: Peter Hyatt <[email protected]>
1 parent fc5438c commit d88f413

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker/models/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def build(self, stream=False, timestamp=False, **kwargs):
317317
if 'stream' in chunk:
318318
if stream:
319319
for line in chunk["stream"].splitlines():
320-
if len(line.strip()) > 0:
320+
if len(line.strip()) > 0 and not bool(re.match(r'^(\s*\x1b\[[0-9;]*m)*\s*(\x1b\[0m)?\s*$', line.strip())):
321321
if timestamp:
322322
print(timestamp_str, "- ", end='')
323323
print(line.strip(), flush=True)

0 commit comments

Comments
 (0)