sublime text 2 for osx,build system,open terminal window
<p>MyCpp.sublime-build</p>
<pre class="brush: jscript;fontsize: 100; first-line: 1; ">{
"cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && open '${file_path}/${file_base_name}'"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'<'${file_path}/${file_base_name}.in'>'${file_path}/${file_base_name}.out'"]
}
]
}
</pre>
<p>第二个Run方法是利用管道重定向输入输出了。</p>
<h3>Reference</h3>
<ul>
<li>http://stackoverflow.com/questions/11601423/how-to-run-programs-in-an-external-console-with-sublime-text</li>
<li>http://www.google.com.hk/search?q=open+terminal&client=pub-1895553756377946&channel=9593578544&forid=1&prog=aff&hl=zh-CN</li>
<li>http://www.wikihow.com/Open-Applications-Using-Terminal-on-Mac</li>
</ul>
--End--