0

I am trying to run a golang application in interactive mode (so that it will prompt users for information it needs) from nodejs, like so:

childprocess.execFileSync(pulumiExecutable, ["stack", "select"], { encoding: "utf-8", shell: true, stdio: "inherit" });

However it uses this function to automatically disable interactive mode, if it thinks that it is not run from a terminal. Presumably because IsTerminal() is returning false.

Given that I am telling nodejs to inherit IO streams from the parent process, I am wondering what else I can try to do in order to stay in interactive mode when invoking pulumi from within nodejs.

d_inevitable
  • 4,381
  • 2
  • 29
  • 48

1 Answers1

1

Turns out that there were two reasons why it was not running in interactive mode:

  1. Running the nodejs program as WebStorm Run Configuration makes it non-interactive.
  2. Running the child-process in shell mode makes it non-interactive too.

This works when the nodejs program is run from a terminal:

childprocess.execFileSync(pulumiExecutable, ["stack", "select"], { encoding: "utf-8", stdio: "inherit" });
d_inevitable
  • 4,381
  • 2
  • 29
  • 48