コンテンツにスキップ
View as Markdown

このコンテンツはまだ日本語訳がありません。

PtyCreateOptions

Options used when creating a PTY session in a Sandbox.

Constructors

new PtyCreateOptions()

public PtyCreateOptions()

Creates PTY options with default dimensions (120x30).

new PtyCreateOptions()

public PtyCreateOptions(String id, int cols, int rows, Consumer<byte[]> onData)

Creates PTY options with explicit values.

Parameters:

  • id String - custom PTY session identifier; if null, the server generates one
  • cols int - terminal width in columns
  • rows int - terminal height in rows
  • onData Consumer<byte[]> - callback invoked for each PTY output chunk

Methods

getId()

public String getId()

Returns the PTY session identifier to request.

Returns:

  • String - requested PTY session identifier, or null to auto-generate

setId()

public PtyCreateOptions setId(String id)

Sets the PTY session identifier.

Parameters:

  • id String - PTY session identifier

Returns:

  • PtyCreateOptions - this options instance

getCols()

public int getCols()

Returns terminal width in columns.

Returns:

  • int - terminal width

setCols()

public PtyCreateOptions setCols(int cols)

Sets terminal width in columns.

Parameters:

  • cols int - terminal width

Returns:

  • PtyCreateOptions - this options instance

getRows()

public int getRows()

Returns terminal height in rows.

Returns:

  • int - terminal height

setRows()

public PtyCreateOptions setRows(int rows)

Sets terminal height in rows.

Parameters:

  • rows int - terminal height

Returns:

  • PtyCreateOptions - this options instance

getOnData()

public Consumer<byte[]> getOnData()

Returns callback used for streaming PTY output.

Returns:

  • Consumer\<byte[]\> - PTY output callback, or null when not configured

setOnData()

public PtyCreateOptions setOnData(Consumer<byte[]> onData)

Sets callback invoked for each PTY output chunk.

Parameters:

  • onData Consumer<byte[]> - callback receiving raw PTY bytes

Returns:

  • PtyCreateOptions - this options instance

PtyResult

Final outcome of a PTY session.

Contains exit status and an optional error/exit reason reported by the PTY backend.

Constructors

new PtyResult()

public PtyResult(int exitCode, String error)

Creates a PTY result object.

Parameters:

  • exitCode int - exit code returned by the PTY process; negative values indicate no exit code
  • error String - optional error or exit reason

Methods

getExitCode()

public int getExitCode()

Returns the process exit code.

Returns:

  • int - PTY process exit code

getError()

public String getError()

Returns the PTY error or exit reason when available.

Returns:

  • String - error message, or null when the session ended successfully