[New-bugs-announce] [issue13609] Add "os.get_terminal_size()" function

Denilson Figueiredo de Sá report at bugs.python.org
Fri Dec 16 02:01:38 CET 2011

New submission from Denilson Figueiredo de Sá <denilsonsa at gmail.com>:

Please add a function called "os.get_terminal_size()" that should return a tuple "(width, height)".

The built-in "argparse" module would directly benefit from this function, as it would wrap the help text correctly. I'm pretty sure many users would also benefit from it.

Once this function gets implemented, issue #13041 can be trivially fixed. There are some suggestions about how to implement this feature in issue #8408.

[extra feature:] After this function gets implemented, it might be a good idea to implement some kind of API to detect size changes without requiring probing. (or, at least, the documentation should give some directions about how to achieve it)

components: Library (Lib)
messages: 149586
nosy: denilsonsa
priority: normal
severity: normal
status: open
title: Add "os.get_terminal_size()" function
type: enhancement

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list