terminal icon indicating copy to clipboard operation
terminal copied to clipboard

tqdm (a Python Package) Not Working Correctly in WSL

Open JeremyCCHsu opened this issue 8 years ago • 4 comments

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

JeremyCCHsu avatar Nov 09 '18 18:11 JeremyCCHsu

Tracking internally as MSFT:19724399

zadjii-msft avatar Nov 26 '18 18:11 zadjii-msft

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 avatar Dec 05 '18 21:12 zadjii-msft

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 avatar Dec 06 '18 04:12 JeremyCCHsu

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 avatar Dec 06 '18 17:12 zadjii-msft