public class PtyProcessBuilder extends Object
ProcessBuilder
for launching a child process with pseudo-terminal.
A pseudo-terminal is a special kind of pipe, so when we launch a new child process
with a Terminal
, a special kind of fork needs to be used, hence this class
and not the standard ProcessBuilder
.
Constructor and Description |
---|
PtyProcessBuilder() |
Modifier and Type | Method and Description |
---|---|
List<String> |
commands() |
PtyProcessBuilder |
commands(List<String> cmds) |
PtyProcessBuilder |
commands(String... cmds) |
PtyProcessBuilder |
env(String name,
String value) |
Map<String,String> |
envs() |
PtyProcessBuilder |
envs(Map<String,String> envs) |
ProcessWithPty |
fork()
Uses JNA to fork a process without external helper.
|
ProcessWithPty |
forkWithHelper()
Uses Python helper code to handle tty.
|
PtyProcessBuilder |
pwd(File pwd) |
public PtyProcessBuilder commands(List<String> cmds)
public PtyProcessBuilder commands(String... cmds)
public PtyProcessBuilder pwd(File pwd)
public PtyProcessBuilder env(String name, String value)
public PtyProcessBuilder envs(Map<String,String> envs)
public ProcessWithPty forkWithHelper() throws IOException
IOException
public ProcessWithPty fork()
Copyright © 2015. All rights reserved.