[][src]Function rexpect::session::spawn

pub fn spawn(program: &str, timeout_ms: Option<u64>) -> Result<PtySession>

Start command in background in a pty session (pty fork) and return a struct with writer and buffered reader (for unblocking reads).

#Arguments:

  • program: This is split at spaces and turned into a process::Command if you wish more control over this, use spawn_command
  • timeout: If Some: all exp_* commands time out after x millisecons, if None: never times out. It's higly recommended to put a timeout there, as otherwise in case of a problem the program just hangs instead of exiting with an error message indicating where it stopped. For automation 30'000 (30s, the default in pexpect) is a good value.