且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Sublime Text 3构建系统:保持控制台运行

更新时间:2022-05-03 02:10:16

好吧,我终于找到了在外部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.