code: func (t *terminal) Wait() (*ExecResult, error) {
  	err := t.cmd.Wait()
  	if err != nil {
  		if exitErr, ok := err.(*exec.ExitError); ok {
  			status := exitErr.Sys().(syscall.WaitStatus)
  			return &ExecResult{Code: status.ExitStatus(), Command: t.cmd.Path}, nil
  		}
  		return nil, err
  	}
  
  	status, ok := t.cmd.ProcessState.Sys().(syscall.WaitStatus)
  	if !ok {
  		return nil, trace.Errorf("unknown exit status: %T(%v)", t.cmd.ProcessState.Sys(), t.cmd.ProcessState.Sys())
  	}
  
  	return &ExecResult{
  		Code:    status.ExitStatus(),
  		Command: t.cmd.Path,
  	}, nil
  }
docs: // Wait will block until the terminal is complete.