如何在Sublime Text中显示OSX终端的生成结果2 [英] How to Show Build Results in OSX Terminal from Sublime Text 2

查看:210
本文介绍了如何在Sublime Text中显示OSX终端的生成结果2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚从TextMate切换到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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆