Requires Scripting PRO
Represents a writable input stream for a TTY (teletypewriter) session opened over SSH. This class allows writing text to the remote terminal’s standard input and resizing the terminal window dynamically.
This class is typically returned from methods such as SSHClient.withPTY() and SSHClient.withTTY().
write(data: string): Promise<void>Writes the given string to the standard input of the TTY session.
data (string):
The string data to send to the remote terminal’s stdin. This can include control characters (e.g., "\r" for Enter, "\x03" for Ctrl+C).Promise that resolves when the data has been successfully written to the TTY stream.changeSize(options: { cols: number; rows: number; pixelWidth: number; pixelHeight: number }): Promise<void>Resizes the remote terminal window. This is useful for applications that rely on terminal dimensions, such as text editors or full-screen tools (e.g., vim, htop).
options (object):
An object describing the new terminal dimensions:
cols (number):
The number of character columns in the terminal (e.g., 80).
rows (number):
The number of character rows in the terminal (e.g., 24).
pixelWidth (number):
The pixel width of the terminal window. Use 0 if not applicable.
pixelHeight (number):
The pixel height of the terminal window. Use 0 if not applicable.
Promise that resolves once the terminal size has been successfully updated.