mirror of https://github.com/docker/docker-py.git
Strip extra escape codes on empty lines
Signed-off-by: Peter Hyatt <peter.hyatt@gmail.com>
This commit is contained in:
parent
fc5438cbee
commit
d88f413e10
|
@ -317,7 +317,7 @@ class ImageCollection(Collection):
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue