如何在Sublime Text中显示OSX终端的生成结果2 [英] How to Show Build Results in OSX Terminal from Sublime Text 2
问题描述
困扰我的一件事是默认的构建结果显示在ST2的底部。我的程序产生了一些非常长的结果,并且显示它的理想方式(如在TM2中)是并排看到它们。
我如何在Mac OS中使用ST2做同样的事情?我发现这篇文章它讨论了如何在Linux中完成这项工作。但仍然无法弄清楚如何适应Mac OS。
非常感谢!
您可以创建一个shell脚本,通过 Terminal.app 作为Python脚本执行传递的输入。 //developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/osascript.1.htmlrel =nofollow> osascript ,如下所示:
#!/ bin / sh
osascript -e'
运行参数
告诉应用程序终端
激活
使用命令python&参数
end tell
结束运行
'$ @
然后您可以创建构建系统:
{
cmd:[sh PATH_TO_SHELL_SCRIPT \$ file \\ \\],
shell:true
}
I just switched to Sublime Text 2 from TextMate, and I absolutely like it a lot. One thing that bothers me is that the default Build Results shows in the bottom part of ST2. My program produces some very long results, and the ideal way to display it (like in TM2) is to see them side by side.
How can I do the same thing with ST2 in Mac OS? I've found this article which talks about how this can be done in Linux. But still couldn't figure out how to adapt it to Mac OS.
Thanks a lot!
You can create a shell script that executes the passed input as a Python script in Terminal.app
, via osascript, like this:
#!/bin/sh
osascript -e '
on run parameters
tell application "Terminal"
activate
do script with command "python " & parameters
end tell
end run
' $@
Then you can create the build system:
{
"cmd": ["sh PATH_TO_SHELL_SCRIPT \"$file\""],
"shell": true
}
这篇关于如何在Sublime Text中显示OSX终端的生成结果2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!