Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by Elle518 for Compile and run in Mac Terminal Sublime Text files

After days of searching I've finally found a solution! In Mac there is no need of a script, all that you need is the proper Build System.

This one for C files:

"cmd": ["bash", "-c", "gcc '${file}' -o '${file_path}/${file_base_name}'&& open -a Terminal.app '${file_path}/${file_base_name}'"]

And this one for C++ files:

"cmd": ["bash", "-cpp", "g++'${file}' -o '${file_path}/${file_base_name}'&& open -a Terminal.app '${file_path}/${file_base_name}'"]

Now, when I press Cmd+B, a new Terminal window opens and my file runs, and of course it accepts input from the user, which sublime text console doesn't...

Simple and easy! All the credits to this guy: https://stackoverflow.com/a/18562836/4359229


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>