PTY.spawn(command_line) => [r, w, pid]
PTY.spawn(command, arguments, ...) { |r, w, pid| ... }
PTY.spawn(command, arguments, ...) => [r, w, pid]
Spawns the specified command on a newly allocated pty. You can also use the alias ::getpty.
The command's controlling tty is set to the slave device of the pty and its standard input/output/error is redirected to the slave device.
command and command_line are the full commands to
run, given a String. Any additional arguments will be passed
to the command.
Return values
In the non-block form this returns an array of size three, [r, w,
pid].
In the block form these same values will be yielded to the block:
-
r -
A readable IO that that contains the command's standard output and standard error
-
w -
A writable IO that is the command's standard input
-
pid -
The process identifier for the command.
Please login to continue.