ScriptPtyShellSession constructor

ScriptPtyShellSession(
  1. Process _process, {
  2. String? ttyFile,
  3. Directory? ttyDir,
})

Wraps an already-started script Process. ttyFile (and its owning ttyDir) carry the child PTS path for resize.

Implementation

ScriptPtyShellSession(this._process, {String? ttyFile, Directory? ttyDir})
  : _ttyFile = ttyFile,
    _ttyDir = ttyDir {
  // Remove the temp dir whether the session is killed or the child exits.
  unawaited(
    _process.exitCode.then((_) => _cleanupTtyDir()).catchError((_) {}),
  );
}