It's inconvenient to build and run a C/C++ program by clicking on both the button "build" and the button "run". Many other IDEs, for example, Code::blocks and Dev-C++, provide a "build and run" botton in their toolbars. Why not add a "compile and run" or "build and run" button to the toolbar of Geany?
Its possible, just needs "somebody" to do it.
But its only really useful for single file programs, where the executable has the same name as the source After that its normal to start using "make" style builds, and then nothing specifies what the executable is called. I guess nobody has thought it worth the effort to save one keystroke/click.
This is very important for OJer, and I wish Geany had this feature too.
Wouldn't this already be possible with just reprogramming the 'Set Build Commands'? Or, if you're working on several projects, setting the Project|Properties|Build commands?
"Build" and "Execute" actions are handled differently.
Build actions do not allow user input and have their output captured and analysed for errors/warnings and then displayed in the compiler tab of the message window as a clickable list. Execute actions are executed in a terminal window (either the embedded one or a separate one) so the user can interact with it and output with terminal control sequences will work.
Just programming a build/execute command to build and run can only be one of those since Geany cannot separate the "build" part of a command from the "run" part of a command so you will lose some capability.
Thats why "somebody" needs to add a capability to select two separate parts of the "build and run". Perhaps it could be as simple as selecting two build menu commands, but it still needs coding, and UI to set it.
@elextr is right for a proper implementation and I agree this might be of little use for more than simple single file programs.
If needed, you can configure Geany to build your code in the run command. Just tested and works pretty good if you can live to have the compiler output in the terminal used for executing the built code:
Build command configuration: ![build_and_run_config](https://github.com/geany/geany/assets/617017/ee61797f-777e-47a9-ba5c-71a7aab...)
And using the Run command to build and execute the code: ![build_and_run_executed](https://github.com/geany/geany/assets/617017/e00b47e0-b5eb-40d9-9c43-af460e4...)
It's not perfect but might be sufficient.
@eht16 I don't get the underline squiggle in the editor pane, how did you do that?
Oh, sorry. This was a left over from a previous "Build" command result. Unfortunately in this case very misleading, so I recreated the screenshot in the above post. Sorry for the confusion.
github-comments@lists.geany.org