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

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:
Location: <PROGRAM_HOME>/bin/launch-program
Working Directory: <PROGRAM_HOME>
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?

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

Related

How to show both internal terminal and debug console in vscode?

I need to debug a program on a server and would like to still have its output in GDB.
The following "works" in general:
manual started (terminal) task that opens a ssh connection, does the necessary pre-setup (server-side scripts), then runs gdbserver --multi :12345
GDB debug configuration that runs in attach mode and executes the appropriate command chain "set sysroot remote:", "target extended-remote myserver:12345", "set remote exec-file /path/to/myfile", "run"
I know see the program running and stopping on the breakpoint, see the program's output in the integrated terminal and can toggle to the debugging console. But how can I see both the debugging console and the integrated terminal at once?
If somehow possible I'd like to not use an external window for one of those, as there are multiple vscode instances open - each connecting to a different server - and multiple windows "mgically" belonging to each other would make debugging harder together - the integrated option solves this problem completely.
The Views and Panels (Problems - Terminal - Output - Debug console) can be moved.
Click on the header/Tab of the View/Panel and drag the mouse to the new location.
The mouse pointer will change if it is possible to drop it.
You can restore a panel/view to the original location from the context menu on the top-bar.
I have looked in the doc but could not find any mentioning of this. It was mentioned in one of the Release notes.

Run a local command before starting eclipse debugging

I want to run a terminal command just before a debug configuration starts on Eclipse.
I heard about CDT launch Groups, but couldnt get around it fully. I need to just run a normal terminal command, nothing fancy.
The aim is to copy some stuff over to the execution path before actually starting the debugging.
I managed to do this via "Launch Groups" in the CDT. Creating 2 groups, one as a c/C++ Application which calls a shell script that includes the command I want to run. And then the normal debug configuration I wanted to execute.

Stop Eclipse Command Line Pop Ups

I am writing a small FLTK (GUI) program on windows 7 using Eclipse Kepler. My "int main()" function is not even set to receive any command line arguments, yet every time I build the program exe and run it a command line pops up being the GUI interface.
Does anyone know how to suppress this? I do not need a console display for any input or output etc. as this is all controlled via the GUI interface.
Thanks.
It has nothing to see with eclipse. It's a standard behaviour of c++ applications on Windows. Look for console on this page. You will find how to disable it.

Automatically Terminating Previously Running Python Interprets when Relaunching in Eclipse

Is there an option for the Eclipse plugin Pydev which would cause Pydev to automatically terminate any already running python instances when a new python instance is launched?
There is an option in Preferences --> Run/Debug --> General Options --> Remove terminated launches when new launches are created
I would need an option of the type: "Terminate and Remove all launches when new launches are created"
Sort of...
you can do the following: do a regular launch and take a look at the buttons in the PyDev console. There are options to terminate all launches, and to relaunch the last launch terminating the current one -- the shortcuts appear if you hover over the buttons:
So (provided you have focus on a PyDev editor):
terminate all launches: Ctrl+Alt+F9
terminate current and relaunch it: Ctrl+Shift+F9
Not exactly what you want, but I think it's the closer it gets right now...

Eclipse - Running programs not in the native eclipse console

I'm currently writing some ncurses code and the native Eclipse (3.2.2) console can't display its graphics. I'd instead like to run the program through xterm. What I want is to be able to start xterm and run from there. I'd prefer to not get involved with any plugins or that jazz. Just something simple.
EDIT
So I have the answer and it was pretty simple...
Run -> External Tools -> External Tools -> New Launch Config...
Then select location of your terminal emulator. /usr/bin/gnome-terminal in my case.
after that set the appropriate arguments. "-e ~/ncurses/start" in my case.
Then make sure you aren't allocating a console by unchecking that option in the "Common" tab.
Annon add to his question:
its a pain to keep switching back and forth from eclipse and the terminal. I'm looking for a way to just hit something like"F5" and have it run my ncurses program in a new xterm terminal process
The simplest way to do that is to report the command line into an external tool configuration, and point eclipse to use a shell (like described in this program)
In the argument, you will add the command line eclipse execute (command line which can be retrieved as mentioned in the second part of this answer below).
Of course, replace 'cmd.exe' by the shell of your choice, and try not setting the 'Allocate Console' checkbox in the Common tab of that external launcher.
To launch through a xterm, without eclipse involved (not what you are asking for, just keep here for archive)
You can launch your program through Eclipse (Run Configurations), and observe through a 'ps' command the exact Java command line used.
Or launch it in debug mode, and right click the task in Debug view and open Properties. It will show the command line, as documented here.
Then launch that command line directly in your console (Eclipse being not involved at all at this point).