Skip to content

Commit bd78be2

Browse files
committed
Fix hide_progress() behavior on Windows platforms
1 parent 295636a commit bd78be2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mbed/mbed.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,12 @@ def show_progress(title, percent, max_width=80):
187187
line += '| ' + show_percent + '%'
188188
sys.stdout.write(line+'\r')
189189
sys.stdout.flush()
190-
sys.stdout.write('\b')
191190

192-
def hide_progress():
193-
sys.stdout.write("\033[K\r\b")
191+
def hide_progress(max_width=80):
192+
line = ''
193+
for i in range(0, max_width):
194+
line += ' '
195+
sys.stdout.write("\r%s\r" % line)
194196

195197
# Process execution
196198
class ProcessException(Exception):

0 commit comments

Comments
 (0)