pytest-dev / py

Python development support library (note: maintenance only)
MIT License
67 stars 106 forks source link

Use shutil.get_terminal_size() in Python 3 #174

Closed nicoddemus closed 5 years ago

nicoddemus commented 6 years ago

Let's use shutil.get_terminal_size if available. This produces the correct size on Windows, and seems pretty fast:

$ python -m timeit -s "import shutil" "shutil.get_terminal_size()"
100000 loops, best of 3: 14.6 usec per loop
Victorious3 commented 5 years ago

Yes, please, this is the second thing that's bugging me! I can make a PR for this if required.

nicoddemus commented 5 years ago

I can make a PR for this if required.

A PR would be welcome, thanks! 😁