code: @Override
    public Object execute(@Nonnull final CommandContext context) throws Exception {
      IO io = context.getIo();
      Variables variables = context.getVariables();
  
      // TODO: args may need special handling for ~/ as this won't translate to executable
  
      log.debug("Executing: {}", args);
  
      ProcessBuilder builder = new ProcessBuilder()
        .command(args)
        .inheritIO();
  
      File dir = directory;
      if (dir == null) {
        dir = variables.require(VariableNames.SHELL_USER_DIR, File.class);
      }
      log.debug("Directory: {}", dir);
      builder.directory(dir);
  
      if (!newenvironment) {
        log.debug("Propagating environment variables");
        builder.environment().putAll(System.getenv());
      }
  
      Process p = builder.start();
  
      PumpStreamHandler handler = new PumpStreamHandler(io.streams.out, io.streams.err);
      handler.setProcessInputStream(p.getOutputStream());
      handler.setProcessOutputStream(p.getInputStream());
      handler.setProcessErrorStream(p.getErrorStream());
  
      handler.start();
  
      log.debug("Waiting for process to exit...");
  
      int exitCode = p.waitFor();
  
      log.debug("Process exited w/code: {}", exitCode);
  
      handler.stop();
  
      return exitCode;
    }
docs: TODO: Consider adapting more of ant exec to support more features?