Skip to content

Commit

Permalink
Strip extra escape codes on empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
peteristhegreat authored and Peter Hyatt committed Apr 5, 2024
1 parent 0dd5483 commit 2bfe551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/models/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def build(self, stream=False, timestamp=False, **kwargs):
if 'stream' in chunk:
if stream:
for line in chunk["stream"].splitlines():
if len(line.strip()) > 0:
if len(line.strip()) > 0 and not bool(re.match(r'^(\s*\x1b\[[0-9;]*m)*\s*(\x1b\[0m)?\s*$', line.strip())):
if timestamp:
print(timestamp_str, "- ", end='')
print(line.strip(), flush=True)
Expand Down

0 comments on commit 2bfe551

Please sign in to comment.