Author zbysz
Recipients Arfrever, amaury.forgeotdarc, denilsonsa, giampaolo.rodola, loewis, neologix, pitrou, rosslagerwall, vstinner, zbysz
Date 2012-01-06.23:07:00
SpamBayes Score 2.94395e-07
Marked as misclassified No
Message-id <1325891221.45.0.805076589081.issue13609@psf.upfronthosting.co.za>
In-reply-to
Content
>> - fd argument is retained, because we might want to test terminals
>>  opened with openpty.
>
> You mean a terminal different than the one used for stdin, stdout and 
> stderr?

For example, let's see what is the size of my two xterms:

>>> os.get_terminal_size_raw()
os.terminal_size(columns=125, rows=39)
>>> fd = os.open('/proc/22736/fd/1', os.O_RDONLY)
>>> fd
6
>>> os.get_terminal_size_raw(6)
os.terminal_size(columns=95, rows=33)

I'm not saying that this serves a clear purpose, but it is possible
and it is good not the restrain the API. I'm sure somebody could find
a use for it.

>> - two functions: still there. I think that get_terminal_size() should
>>  provide an easy-to-use, even trivial-to-use, way to get a sensible
>>  value without writing a wrapper. In the _majority_ of cases the
>>  wrapper would be something like get_terminal_size() currently.
>
> get_terminal_size() looks like [less?] reliable than raw_get_terminal_size()
> because environment variables are not updated when the terminal is
> resized.
Please look at my comment above: http://bugs.python.org/issue13609#msg149620
$COLUMNS is only used for overriding -- it normally _isn't_ set.
History
Date User Action Args
2012-01-06 23:07:01zbyszsetrecipients: + zbysz, loewis, amaury.forgeotdarc, pitrou, vstinner, giampaolo.rodola, Arfrever, denilsonsa, neologix, rosslagerwall
2012-01-06 23:07:01zbyszsetmessageid: <1325891221.45.0.805076589081.issue13609@psf.upfronthosting.co.za>
2012-01-06 23:07:00zbyszlinkissue13609 messages
2012-01-06 23:07:00zbyszcreate