code: func New(opts ...func(*Runner) error) (*Runner, error) {
  	r := &Runner{usedNew: true}
  	r.dirStack = r.dirBootstrap[:0]
  	for _, opt := range opts {
  		if err := opt(r); err != nil {
  			return nil, err
  		}
  	}
  	// Set the default fallbacks, if necessary.
  	if r.Env == nil {
  		Env(nil)(r)
  	}
  	if r.Dir == "" {
  		if err := Dir("")(r); err != nil {
  			return nil, err
  		}
  	}
  	if r.Exec == nil {
  		Module(ModuleExec(nil))(r)
  	}
  	if r.Open == nil {
  		Module(ModuleOpen(nil))(r)
  	}
  	if r.Stdout == nil || r.Stderr == nil {
  		StdIO(r.Stdin, r.Stdout, r.Stderr)(r)
  	}
  	return r, nil
  }
docs: // New creates a new Runner, applying a number of options. If applying any of
  // the options results in an error, it is returned.
  //
  // Any unset options fall back to their defaults. For example, not supplying the
  // environment falls back to the process's environment, and not supplying the
  // standard output writer means that the output will be discarded.