Sublime Text 3构建系统:保持控制台运行 [英] Sublime Text 3 build system: keep console running

查看:111
本文介绍了Sublime Text 3构建系统:保持控制台运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sublime Text 3中设置了一个构建系统来运行Matlab文件.这真的很好:

I set up a build system in Sublime Text 3 to run Matlab files. This works really fine:

{ "cmd":["/usr/local/MATLAB/R2013b/bin/matlab",-nosplash",-nodesktop",-nojvm",-r \" run('$ file'); \"] }

{ "cmd": ["/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-nojvm", "-r \"run('$file');\""] }

问题是执行$ file后,我想让Matlab在Sublime控制台中运行.这可能吗?

The problem is I want to keep Matlab running in the Sublime console after $file is executed. Is this possible?

谢谢.

推荐答案

好吧,我终于找到了在外部xterm终端中运行构建系统的解决方案.如果您使用此Sublime,将打开xterm窗口并在其中执行构建系统.该窗口保持打开状态,例如执行代码后,不会关闭Matlab绘图窗口.我已经将带有或不带有外部终端的构建系统组合到一个构建系统中:

Ok, I've finally found a solution that runs the build system in an external xterm terminal. If you use this Sublime will open a xterm window and execute the build system there. This window remains open, so e.g. Matlab plot windows will not be closed after execution of the code. I've combined the build system with and without the external terminal into one build system:

{
    "cmd": ["/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-r \"run('$file');quit;\""],
"selector": "source.m",

"variants": [
    { 
        "name": "xterm",
        "cmd": ["xterm", "-e", "/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-r \"run('$file');\""]
    }
]
}

,然后分配了用户密钥绑定以轻松访问xterm变体:

and then assigned a user key binding to access the xterm variant easily:

[
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"variant": "xterm"} }
]

此xterm解决方案还应与您要防止在代码执行完成后关闭的任何其他解释器一起使用.

This xterm solution should also work with any other interpreter that you want to prevent from being closed after code execution finishes.

这篇关于Sublime Text 3构建系统:保持控制台运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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