classification
Title: argparse: terminal width is not detected properly
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: argparse: terminal width is not detected properly
View: 13041
Assigned To: Nosy List: zbysz
Priority: normal Keywords: patch

Created on 2011-09-24 22:07 by zbysz, last changed 2011-09-24 22:48 by zbysz. This issue is now closed.

Files
File name Uploaded Description Edit
patch1.diff zbysz, 2011-09-24 22:07 review
Messages (2)
msg144508 - (view) Author: Zbyszek Jędrzejewski-Szmek (zbysz) * Date: 2011-09-24 22:07
COLUMNS is a shell variable (updated whenever the window size
changes), that usually isn't exported to programs. Therefore checking
for COLUMNS in sys.environ will not work in the majority of cases. The
proper check is to use the TIOCGWINSZ ioctl on stdout.
    
Why COLUMNS is not exported? Because it can change during the lifetime
of a program. Therefore it is better to use the dynamic ioctl.
msg144511 - (view) Author: Zbyszek Jędrzejewski-Szmek (zbysz) * Date: 2011-09-24 22:48
Hm, I have somehow submitted the same tex ttwwiiccee. Sorry about that.
History
Date User Action Args
2011-09-24 22:48:08zbyszsetmessages: + msg144511
2011-09-24 22:12:15ezio.melottisetstatus: open -> closed
resolution: duplicate
superseder: argparse: terminal width is not detected properly
stage: resolved
2011-09-24 22:07:20zbyszcreate