New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added screen size parameters. #11
Conversation
Seems fine, thanks. I thought about asking for |
This does all the fork/exec type of stuff for a pty, and returns an | ||
instance of PtyProcess. | ||
|
||
If preexec_fn is supplied, it will be called with no arguments in the | ||
child process before exec-ing the specified command. | ||
It may, for instance, set signal handlers to SIG_DFL or SIG_IGN. | ||
|
||
Dimensions of the psuedoterminal used for the subprocess can be | ||
specified as a tuple, or the default (24, 80) will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be precise '...as a tuple (rows, cols), ...'
Heh, I hadn't thought about that inconsistency actually. Well, I'll leave
|
I can make that change.
|
+1 |
Thanks! |
Added screen size parameters.
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).