tqdm (a Python Package) Not Working Correctly in WSL #448

Closed
opened 2026-01-30 21:52:38 +00:00 by claunia · 4 comments
Owner

Originally created by @JeremyCCHsu on GitHub (Nov 9, 2018).

Originally assigned to: @zadjii-msft on GitHub.

tqdm is a popular progress bar package in Python, but in my WSL, it behaves incorrectly as the following picture:
img
The length of the whole frame grows and results in mis-alignment.

Expected behavior is like this:
img
The length of the frame has a fixed length; only the progress bar grows visually.

Code to reproduce the results:

pip install tqdm
python
from time import sleep
from tqdm import tqdm

for _ in tqdm(range(10000)):
    sleep(0.1)

Environment

  • OS: Microsoft Windows [Version 10.0.17134.345]
  • WSL:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
  • Python 3.7.1
Originally created by @JeremyCCHsu on GitHub (Nov 9, 2018). Originally assigned to: @zadjii-msft on GitHub. `tqdm` is a popular progress bar package in Python, but in my WSL, it behaves incorrectly as the following picture: ![img](https://0z0g0w.dm.files.1drv.com/y4mQZXEdOOxm35-Mvgdx6ZfJxDv7BFs-T8KW0jBsxGarxDzt1qf_spWu4zKAFrqiKM0Et37cdks5qKGhajudfE9x5u9Jm4sDOBJqc1XQklf4ealCr_oAEbNrK4tj6Ovwikvk6LWQlwsJrl9_ZvSYElftAACdFo56MmzTcUAprEASkdjDRcRqSPDYtmw66qnChWGLtfuQJIZL6cxq29UEKu3WA/tqdm-incorrect.png?psid=1) The length of the whole frame grows and results in mis-alignment. Expected behavior is like this: ![img](https://0j0g0w.dm.files.1drv.com/y4mBilq45pmDhdxRiVHhSGk2W--1SnR9-w_IHjFzuUtIuYkWh_uAS-_xkYdnCb3Dt9_yEmzW71G0KrFjpDBGvDeEfQzMBBQ9KJumHjgH9y4ZFEhbMHIXMZ9bpsTznPD0sNkIQRMz1sJdoMU7IauYHw_qU92M96thx0JoZQg1R50LVUuApRXJu5Vx_jSKgxaLc_2vbVIWdKkyOPxhKMMLnJgDA/tqdm-correct.png?psid=1) The length of the frame has a fixed length; only the progress bar _grows_ visually. Code to reproduce the results: ```bash pip install tqdm python ``` ```python from time import sleep from tqdm import tqdm for _ in tqdm(range(10000)): sleep(0.1) ``` # Environment - OS: Microsoft Windows [Version 10.0.17134.345] - WSL: ```bash $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic ``` - Python 3.7.1
claunia added the Product-ConhostNeeds-Repro labels 2026-01-30 21:52:38 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 26, 2018):

Tracking internally as MSFT:19724399

@zadjii-msft commented on GitHub (Nov 26, 2018): Tracking internally as MSFT:19724399
Author
Owner

@zadjii-msft commented on GitHub (Dec 5, 2018):

Looks like it's working fine to me:

gh-304

Can you test on RS5 / October 2018 / Windows 1809 Release / version 17763 and see if it works on that build?

If it doesn't, then I'm assuming that it was fixed sometime after RS5 was snapped. I could try and bisect and find when it was actually fixed, but that'd take away from time I could be using to fix other bugs :P

@zadjii-msft commented on GitHub (Dec 5, 2018): Looks like it's working fine to me: ![gh-304](https://user-images.githubusercontent.com/18356694/49544089-cb05ce80-f88e-11e8-8ded-647cb9b8295d.gif) Can you test on RS5 / October 2018 / Windows 1809 Release / version 17763 and see if it works on that build? If it doesn't, then I'm assuming that it was fixed sometime after RS5 was snapped. I could try and bisect and find when it was actually fixed, but that'd take away from time I could be using to fix other bugs :P
Author
Owner

@JeremyCCHsu commented on GitHub (Dec 6, 2018):

Hi, thanks for your reply. However, I updated my Surface Pro 4 to Build 1809, and the problem was still there. I noticed that you ran your code via cmd whereas I ran it under Windows Subsystem Linux (installed from Microsoft Store, according to this guide). Do you have any other suggestions?

Update: tqdm has the same issue under Anaconda Prompt on my Surface Pro 4.

@JeremyCCHsu commented on GitHub (Dec 6, 2018): Hi, thanks for your reply. However, I updated my Surface Pro 4 to Build 1809, and the problem was still there. I noticed that you ran your code via `cmd` whereas I ran it under Windows Subsystem Linux (installed from Microsoft Store, according to this [guide](https://docs.microsoft.com/en-us/windows/wsl/install-win10)). Do you have any other suggestions? Update: `tqdm` has the same issue under Anaconda Prompt on my Surface Pro 4.
Author
Owner

@zadjii-msft commented on GitHub (Dec 6, 2018):

cmd and wsl both run attached to conhost.exe, which is actually responsible for acting as the terminal application. conhost handles output the same, regardless of how it was launched.

Presumably I fixed it sometime after we stopped committing fixes to RS5 (roughly August) and yesterday. I'd check an Insider's build in a few weeks and see if it still repros on that.

@zadjii-msft commented on GitHub (Dec 6, 2018): `cmd` and `wsl` both run attached to `conhost.exe`, which is actually responsible for acting as the terminal application. conhost handles output the same, regardless of how it was launched. Presumably I fixed it sometime after we stopped committing fixes to RS5 (roughly August) and yesterday. I'd check an Insider's build in a few weeks and see if it still repros on that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#448