Skip to content

Commit

Permalink
Strip extra escape codes on empty lines
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hyatt <peter.hyatt@gmail.com>
  • Loading branch information
peteristhegreat committed Apr 8, 2024
1 parent fc5438c commit d88f413
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 d88f413

Please sign in to comment.