climate: Progress bar rendering on Windows broken

I’m using ANSICON (because default terminal don’t support ANSI escape codes, in fact ANSICON don’t do it well too) on Win8x64, CLImate just renders new line each time it increments, without erasing old one.

So it looks like this:

>
=>
==>
===>
====>
=====>
======>
=======>
========>
=========>
==========>
===========>
============>
=============>
==============>
===============>
================>
=================>
==================>
===================>
====================>
=====================>
======================>
=======================>
========================>
=========================>
==========================>
===========================>
============================>
=============================>
==============================>
===============================>
================================>
=================================>
==================================>
===================================>
====================================>
                         n%

Well, i know that it’s a Windows problem, but look at Composer, it renders progress bar fine even on Windows 😉

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

The solution is to change this line in src/Util/System/Windows.php

$output = $this->exec('mode', true);

by this one

$output = $this->exec('mode CON', true);

A pull Request has been submitted.

I use ConEmu and I see a similar bug with the Padding class that is related to a wrong width size detection of the terminal window. I have solved by the suggestion of @yparisien. Regards from Italy

I’ve tested with Cmder and nothing is broken. I’m on Windows 8.1 using PHP 5.5.12