Method: Explorer::Process#start

Defined in:
lib/explorer/process.rb

#startObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/explorer/process.rb', line 30

def start
  return Actor.current if @state == :started

  @status = nil
  @pipe, slave = PTY.open
  slave.raw!
  @pid = spawn_process(label, command, working_dir: working_dir, pipe: slave)
  @pgid = ::Process.getpgid(@pid)
  slave.close

  @state = :started
  signal :state_changed

  wait_pid
  async.read_pipe

  return Actor.current
end