phpseclib/phpseclib — pull request #71 by tamagokun (2013-02-08 22:13:44+00:00)
Title: enablePTY() disablePTY() for use with exec()

This is a redo of https://github.com/phpseclib/phpseclib/pull/58

You can use enablePTY() or disablePTY() to toggle between sending a 'request-pty' portion to an exec() call.

If you use enablePTY() and then call exec(), you will be able to use read() and write() to act upon the command until the command finishes.

An example:

```php
$ssh->enablePTY();
$ssh->exec('cd ~ && ./age_question.sh');
$output = '';
if( $output .= $ssh->read("How old are you?")) {
$ssh->write("26\n");
}
$output .= $ssh->read();
echo $output;
```

Let me know if there are any other places where I need to unset `in_request_pty_exec`