瀏覽代碼

Merge pull request #4187 from ijc25/pull-urxvt-corruption

progress_stream: Avoid undefined ANSI escape codes
Joffrey F 9 年之前
父節點
當前提交
9bfb855b89
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      compose/progress_stream.py

+ 3 - 4
compose/progress_stream.py

@@ -32,12 +32,11 @@ def stream_output(output, stream):
         if not image_id:
             continue
 
-        if image_id in lines:
-            diff = len(lines) - lines[image_id]
-        else:
+        if image_id not in lines:
             lines[image_id] = len(lines)
             stream.write("\n")
-            diff = 0
+
+        diff = len(lines) - lines[image_id]
 
         # move cursor up `diff` rows
         stream.write("%c[%dA" % (27, diff))