eclipsecommand-lineconfigurationexternal-tools

Handle the click on the Terminate button of an Eclipse's console?


Using Eclipse, I'm launching an external program through an "External Tool Configuration".

My program has a "bin/launch-program" executable, but also a "bin/stop-program" which is the only way to stop the program.

In my Eclipse's External Tool Configuration, tab "Main", I set:

But I'm looking a way to handle the stop event.

In other words, launching an external program works well: I get the output in the Eclipse's console. The question is: how to handle the click on the Terminate button of the console, to launch a specific command line?


Solution

  • terminating the program from the terminate button of the eclipse console is equivalent to kill it by using a task manager. It's not safe to edit the command on the red terminate button, but you can make the program to do things before exiting shutdown hook