Message150776
>> - 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. |
|
Date |
User |
Action |
Args |
2012-01-06 23:07:01 | zbysz | set | recipients:
+ zbysz, loewis, amaury.forgeotdarc, pitrou, vstinner, giampaolo.rodola, Arfrever, denilsonsa, neologix, rosslagerwall |
2012-01-06 23:07:01 | zbysz | set | messageid: <1325891221.45.0.805076589081.issue13609@psf.upfronthosting.co.za> |
2012-01-06 23:07:00 | zbysz | link | issue13609 messages |
2012-01-06 23:07:00 | zbysz | create | |
|