Compile c++ execute code inside of Atom


#1

Hello!

I would like when I compile and run code in c++, with some plugin of terminal, execute code here directly.
I’m using plugin: PlatformIO IDE Terminal
But I’ve a one file opened c++, I put Compile and Run and and execute directly, execute code in terminal, but when I put Compile and run, new terminal is opened of exterior of atom, and I wan´t this. I want when I do click in “Compile and Run”, terminal used is PlatformIO IDE Terminal.

Thank you.


#2

HINT :
Whose package added this to the context menu…?
image


#3

Hello!

Thank you. I know that this it open a new window terminal but I would like that if I click to “Compile and Run”, then, I want to see code compiled in terminal within the Atom, in the plugin PlatformIO IDE Terminal.

He I explained good? :sweat_smile:

Thank you!


#4

Wow, yes! :slight_smile:

The solution was plugin “Script” :slight_smile:

Thank you, a greetings.


#6

I’ve been banging my head into the wall over the same issue for the past few weeks, If this hack works, I’m gon be so glad man!
Somehow the cmd.exe doesn’t work in my laptop, so the gpp-compiler is just useless in my case.


#7

If you can give a clear statement of your needs, I or another veteran Atom user can give you a precise prescription for how to solve your problem.

Somehow the cmd.exe doesn’t work in my laptop, so the gpp-compiler is just useless in my case.

I can’t help you troubleshoot Windows issues, but I’m not sure if this is necessarily a significant problem. You can circumvent the crappy cmd by downloading a different (and more user-friendly) program like ConEmu (which uses the cmd shell, but with so many more things that you can configure), and you can upgrade your experience with the Cmder package, which includes ConEmu and a few other tools in a seamless experience. Once you have another shell on your machine, you can invoke it from process-palette like so:

And since it’s designed by CLI nerds, Cmder accepts arguments, but I can’t seem to get /TASK working. I’ve opened an issue and will be following it since I use Cmder and this functionality is relevant to me. In the mean time, you can just use it as a much superior substitute to your crappier than usual cmd.


#8

Okay, I’ll try to explain the issue I’m facing.
I had been using DevCpp for my C++ coding till recently, I don’t code huge projects in C++, just simple programs aimed towards competitive programming. So, DevCpp is a pretty outdated software and even the Orwell edition has stopped getting updates .
So I want to switch to Atom.

I’ve tried the gpp-compiler package but it shoots up a CMD window (which closes instantly in my case) so this package is ruled out.
Next I tried Script, but I learnt that is doesn’t really support taking Input from user, so this is ruled out too.
You directed me to termination so that I can get a PowerShell CLI in my main window with which I can run my codes, but it is still a tedious job innit?
Is there any package which does the same work as gpp-compiler but uses a PowerShell window to do the same?


#9

The gpp-compiler repo on github has thisindex.js file, scroll down to line 403, I believe maipualting this line will let us spawn a PowerShell window instead of a CMD window.
Any help would be appreciated.


#10

You can do it in process-palette. It gives you the automation capability that you want (to avoid the tedium of typing in the compiler command every time) and can be configured to open a PowerShell window for output. You just have to configure your command as an argument inside a PowerShell command. This worked for me when I tested it:

The annoying bit at the end is necessary to wait for a key input. For your purposes, just replace ls with whatever command you want to run. You will also want to scroll down to the Output settings and change the target to Void to prevent anything from opening inside Atom.

You can easily modify any Atom package by cloning the repo into a folder on your computer (anywhere you like) and running apm link from inside the cloned repo. It will create a symbolic link in .atom/packages/ that points at your code folder, and from then on what Atom loads will be the local repo. You can use apm link -d if you want to only override the package while developer mode is active, and if you do this for a core package, Atom will load your code instead of the code that came with it.


#11

Can you give a step-by-step guide to do that?
I know it’s silly to ask that, but I’m nearing an important deadline and I really need this ASAP.
I have a Windows 10 installation with MinGW installed.


#12

Since I mentioned multiple things, you’re going to have to be more specific about which task you’re referring to as “that”. I explained what I meant in the clearest terms that I could think of. If you are having difficulty, please tell me exactly where and with what.