Prevent Multiple Terminal Sessions Being Created When Invoking (build) Shell Scripts

Answered

I'm building Java code into JAR/JAD files using a Bash shell script (it invokes the Ant builder) and this is executed by having a Run/Debug Configuration which defines the script path, allowing me to be able to simply press the > Run button on the toolbar to invoke the script.  This works fine.

I've currently got Git Bash configured as the Terminal's shell path program, so when I invoke the build script, it opens a Git Bash terminal session and runs the contents of the script (.sh) file.  Again, all good.

The problem I've got is that when I invoke the build script again, it opens up another terminal session to run the script.  Likewise if I run it again, another terminal session window is created.  I end up with a new terminal session each time the script is invoked.

I want the script to run in a single terminal session to avoid multiple terminal sessions being created.

Of course I could close them as I go, of course.  I could also execute the script via the command-line too, but does anybody know if it's possible to force the invocation of additional bash scripts via the > Run button to perform that in the existing terminal session window?

 

0
1 comment

Sods law! After hours of trying to find a solution, I've found one after I've posted the question!

Instead of setting the Run/Debug Configuration to run the script in the terminal, I can untick that option and specify the shell in the 'Interpreter path' of the Run/Debug Configuration.

When the > Run button is pressed, the script is invoked in the 'Run' tab instead of the 'Terminal' session tab.

 

 
1

Please sign in to leave a comment.