Pty class

Pty represents a process running in a pseudo-terminal.

To create a Pty, use Pty.start.

Constructors

Pty.start(String executable, {List<String> arguments = const [], String? workingDirectory, Map<String, String>? environment, String? terminalProgramVersion, int rows = 25, int columns = 80, bool ackRead = false})
Spawns a process in a pseudo-terminal. The arguments have the same meaning as in Process.start. ackRead indicates if the pty should wait for a call to Pty.ackRead before sending the next data.

Properties

arguments List<String>
final
executable String
final
exitCode Future<int>
A Future which completes with the exit code of the process when the process completes.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasRunningForegroundProcess bool
Whether the shell currently has a running foreground command.
no setter
output Stream<Uint8List>
The output stream from the pseudo-terminal. Note that pseudo-terminals do not distinguish between stdout and stderr.
no setter
pid int
The process id of the process running in the pseudo-terminal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

ackRead() → void
indicates that a data chunk has been processed. This is needed when ackRead is set to true as the pty will wait for this signal to happen before any additional data is sent.
destroy() → void
Destroys the PTY handle, closing the master fd and freeing native resources. This should be called when the terminal is disposed to ensure full cleanup.
kill([ProcessSignal signal = ProcessSignal.sigterm]) bool
Kill the process running in the pseudo-terminal.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize(int rows, int cols, {int pixelWidth = 0, int pixelHeight = 0}) → void
Resize the pseudo-terminal.
toString() String
A string representation of this object.
inherited
write(Uint8List data) bool
Write data to the pseudo-terminal.

Operators

operator ==(Object other) bool
The equality operator.
inherited