このコンテンツはまだ日本語訳がありません。
PtyHandle
Section titled “PtyHandle”Handle for interacting with an active PTY session.
Supports bidirectional I/O, resize, kill, and waiting for connection/exit events.
Methods
Section titled “Methods”waitForConnection()
Section titled “waitForConnection()”public void waitForConnection(long timeoutSeconds)Waits for PTY websocket connection to be fully established.
Parameters:
timeoutSecondslong - maximum seconds to wait
Throws:
DaytonaException- if connection fails or times out
sendInput()
Section titled “sendInput()”public void sendInput(String data)Sends text input to PTY.
Parameters:
dataString - UTF-8 text to send
Throws:
DaytonaException- if sending fails
sendInput()
Section titled “sendInput()”public void sendInput(byte[] data)Sends binary input to PTY.
Parameters:
databyte[] - binary payload
Throws:
DaytonaException- if sending fails
waitForExit()
Section titled “waitForExit()”public PtyResult waitForExit()Waits until the PTY session exits.
Returns:
PtyResult- final PTY result
Throws:
DaytonaException- if interrupted while waiting
waitForExit()
Section titled “waitForExit()”public PtyResult waitForExit(long timeoutSeconds)Waits for PTY exit with timeout.
Parameters:
timeoutSecondslong - maximum seconds to wait
Returns:
PtyResult- final PTY result, or timeout result when exit does not occur in time
Throws:
DaytonaException- if interrupted while waiting
resize()
Section titled “resize()”public void resize(int cols, int rows)Resizes terminal dimensions.
Parameters:
colsint - terminal width in columnsrowsint - terminal height in rows
kill()
Section titled “kill()”public void kill()Terminates PTY session.
disconnect()
Section titled “disconnect()”public void disconnect()Disconnects the PTY websocket.
getSessionId()
Section titled “getSessionId()”public String getSessionId()Returns PTY session identifier.
Returns:
String- session ID
getExitCode()
Section titled “getExitCode()”public Integer getExitCode()Returns PTY exit code when available.
Returns:
Integer- exit code, ornullif not known yet
getError()
Section titled “getError()”public String getError()Returns PTY error or exit reason.
Returns:
String- error message, ornullwhen none
isConnected()
Section titled “isConnected()”public boolean isConnected()Returns websocket connectivity status.
Returns:
boolean-truewhen socket is currently connected