Two issues with a prior PR for handling line-spanning progress bars are
fixed in this PR:
- corner case where output line len == term width: extra line was being
added
- line length calculation was including escape characters causing
calculations to span lines when output was still only on one line
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
When we try to pull an image with "ctr pull xxx", the progress bar
display will flush all the screen and make it so hard to find useful
information for user.
This commit fixes bugs for the progress bar, by correcting "line counting"
algorithm. Previous algorithm only counts number of "\n", but one line
can be longer than screen width, in which case it should be counted as
two lines. Also updated the screen cleaning ESC chars.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
With the rename of fetch to fetch-object, we now introduce the `fetch`
command. It will fetch all of the resources required for an image into
the content store. We'll still need to follow this up with metadata
registration but this is a good start.
Signed-off-by: Stephen J Day <stephen.day@docker.com>