compose/compose
Ian Campbell dc9184a90f progress_stream: Avoid undefined ANSI escape codes
The ANSI escape codes \e[0A (cursor up 0 lines) and \e[0B (cursor down 0 lines)
are not well defined and are treated differently by different terminals. In
particular xterm treats 0 as a missing parameter and therefore defaults to 1,
whereas rxvt-unicode treats these escapes as a request to move 0 lines.

However the use of these codes is unnecessary and were really just hiding the
fact that we were not correctly computing diff when adding a new line. Having
added the new line to the ids map and output the corresponding \n the correct
diff would be 1 and not 0 (which xterm interprets as 1) as currently.

Rather than changing the hardcoded 0 to a 1 pull the diff calculation out and
always do it since it produces the correct answer in both cases.

This fixes similar corruption when compose is pulling an image to that seen
with `docker pull` and rxvt-unicode (and likely other terminals in that family)
seen in docker/docker#28111.

This is the same as the fix made to Docker's pkg/jsonmessage in
https://github.com/docker/docker/pull/28238 (and I have shamelessly ripped off
most of this commit message from there).

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-11-25 10:16:37 +00:00
..
cli Use stop grace period for container stop. 2016-11-16 12:12:28 -05:00
config Update messages about docker stack deploy. 2016-11-21 16:34:49 -05:00
__init__.py Switch back to dev version 2016-07-27 13:30:52 -07:00
__main__.py Use json to encode invalid values in configuration errors so that the user sees a proper repr of the value. 2016-01-07 13:09:24 -05:00
bundle.py Fix command hint in bundle to pull services instead of images 2016-09-08 11:17:39 -07:00
const.py Support version 3.0 of the Compose file format 2016-11-16 16:07:02 +00:00
container.py Only allow log streaming if logdriver is json-file or journald 2016-09-13 11:56:26 -07:00
errors.py Catchable error for parse failures in split_buffer 2016-08-02 12:48:32 -07:00
network.py Avoid breaking when remote driver options are null. 2016-11-15 12:00:52 -08:00
parallel.py Use stop grace period for container stop. 2016-11-16 12:12:28 -05:00
progress_stream.py progress_stream: Avoid undefined ANSI escape codes 2016-11-25 10:16:37 +00:00
project.py Update messages about docker stack deploy. 2016-11-21 16:34:49 -05:00
service.py Use stop grace period for container stop. 2016-11-16 12:12:28 -05:00
state.py Implement smart recreate behind an experimental CLI flag 2015-05-18 18:39:18 +01:00
timeparse.py Add a vendored and modified pytimeparse 2016-11-16 12:10:32 -05:00
utils.py Improve volumespec parsing on windows platforms 2016-09-20 11:24:24 -07:00
volume.py add support for creating volume and network with label definition 2016-10-12 10:35:14 +08:00