Skip to content

Commit 2bfe551

Browse files
peteristhegreatph-conn
authored andcommitted
Strip extra escape codes on empty lines
1 parent 0dd5483 commit 2bfe551

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)