Closed detly closed 9 years ago
Seems fine, thanks. I thought about asking for rows
and cols
for symmetry with setwinsize()
, but I agree with you that it would be bizarre to set one without the other.
Heh, I hadn't thought about that inconsistency actually. Well, I'll leave it up to you; sometimes consistency is worth it, sometimes no one will mind :) On 17/03/2015 7:50 AM, "Thomas Kluyver" notifications@github.com wrote:
Seems fine, thanks. I thought about asking for rows and cols for symmetry with setwinsize(), but I agree with you that it would be bizarre to set one without the other.
— Reply to this email directly or view it on GitHub https://github.com/pexpect/ptyprocess/pull/11#issuecomment-81929499.
I can make that change. On 17/03/2015 7:53 AM, "Jason Heeris" jason.heeris@gmail.com wrote:
Heh, I hadn't thought about that inconsistency actually. Well, I'll leave it up to you; sometimes consistency is worth it, sometimes no one will mind :) On 17/03/2015 7:50 AM, "Thomas Kluyver" notifications@github.com wrote:
Seems fine, thanks. I thought about asking for rows and cols for symmetry with setwinsize(), but I agree with you that it would be bizarre to set one without the other.
— Reply to this email directly or view it on GitHub https://github.com/pexpect/ptyprocess/pull/11#issuecomment-81929499.
+1
Thanks!
I found myself wanting to set the size of the
pty
as seen by the subprocess (really forpexpect.spawn
, but this is needed first). In some situations it can make parsing/interaction a lot easier.Happy to change any stylistic things, eg.
dimensions=(24, 80)
default arg could also bedimensions=None
with someif dimensions is not None
logic inspawn()
.r=24, c=80
instead, but does it make sense to only have one dimension with a default? (Maybe, I don't know.)I meant to add a test, but couldn't figure out a simple enough way to test this (eg. if there was a reliable command to check console size it could be like the other
spawn
tests, but I don't know of one).