-2

I run my program, I enter Ctrl+C, obviously I want to stop the program.

But powershell always asks "do you want to stop the program ? (y/N)".

How can I disable this ? I just want the program to stop without this useless prompt.

EDIT : More details

I have a spring boot app, If I run with java -jar and I stop it with Ctrl+C, no prompt.

If I run it with "mvn spring-boot:run", then I stop it with Ctrl+C, I get the prompt. I don't want this prompt.

Solution : replace mvn spring-boot:run with echo y | mvn spring-boot:run

Genku
  • 1

1 Answers1

1

The message is not printed by PowerShell – you are running mvn.cmd, a Cmd batch script, and the message is printed by Cmd (the script interpreter) anytime a .cmd or .bat script is Ctrl-C'd.

There is no option to disable the message, other than avoiding the use of .bat/.cmd scripts.

grawity
  • 501,077