このコンテンツはまだ日本語訳がありません。
PtyCreateOptions
Section titled “PtyCreateOptions”Options used when creating a PTY session in a Sandbox.
Constructors
Section titled “Constructors”new PtyCreateOptions()
Section titled “new PtyCreateOptions()”public PtyCreateOptions()Creates PTY options with default dimensions (120x30).
new PtyCreateOptions()
Section titled “new PtyCreateOptions()”public PtyCreateOptions(String id, int cols, int rows, Consumer<byte[]> onData)Creates PTY options with explicit values.
Parameters:
idString - custom PTY session identifier; ifnull, the server generates onecolsint - terminal width in columnsrowsint - terminal height in rowsonDataConsumer<byte[]> - callback invoked for each PTY output chunk
Methods
Section titled “Methods”getId()
Section titled “getId()”public String getId()Returns the PTY session identifier to request.
Returns:
String- requested PTY session identifier, ornullto auto-generate
setId()
Section titled “setId()”public PtyCreateOptions setId(String id)Sets the PTY session identifier.
Parameters:
idString - PTY session identifier
Returns:
PtyCreateOptions- this options instance
getCols()
Section titled “getCols()”public int getCols()Returns terminal width in columns.
Returns:
int- terminal width
setCols()
Section titled “setCols()”public PtyCreateOptions setCols(int cols)Sets terminal width in columns.
Parameters:
colsint - terminal width
Returns:
PtyCreateOptions- this options instance
getRows()
Section titled “getRows()”public int getRows()Returns terminal height in rows.
Returns:
int- terminal height
setRows()
Section titled “setRows()”public PtyCreateOptions setRows(int rows)Sets terminal height in rows.
Parameters:
rowsint - terminal height
Returns:
PtyCreateOptions- this options instance
getOnData()
Section titled “getOnData()”public Consumer<byte[]> getOnData()Returns callback used for streaming PTY output.
Returns:
Consumer\<byte[]\>- PTY output callback, ornullwhen not configured
setOnData()
Section titled “setOnData()”public PtyCreateOptions setOnData(Consumer<byte[]> onData)Sets callback invoked for each PTY output chunk.
Parameters:
onDataConsumer<byte[]> - callback receiving raw PTY bytes
Returns:
PtyCreateOptions- this options instance
PtyResult
Section titled “PtyResult”Final outcome of a PTY session.
Contains exit status and an optional error/exit reason reported by the PTY backend.
Constructors
Section titled “Constructors”new PtyResult()
Section titled “new PtyResult()”public PtyResult(int exitCode, String error)Creates a PTY result object.
Parameters:
exitCodeint - exit code returned by the PTY process; negative values indicate no exit codeerrorString - optional error or exit reason
Methods
Section titled “Methods”getExitCode()
Section titled “getExitCode()”public int getExitCode()Returns the process exit code.
Returns:
int- PTY process exit code
getError()
Section titled “getError()”public String getError()Returns the PTY error or exit reason when available.
Returns:
String- error message, ornullwhen the session ended successfully