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

Eli*_*sch 4 matlab sublimetext sublimetext3

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

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

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

先感谢您.

Eli*_*sch 6

好的,我终于找到了一个在外部xterm终端中运行构建系统的解决方案.如果您使用此Sublime将打开一个xterm窗口并在那里执行构建系统.此窗口保持打开状态,因此例如在执行代码后不会关闭Matlab绘图窗口.我将构建系统与外部终端结合在一起构建系统:

{
    "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');\""]
    }
]
}
Run Code Online (Sandbox Code Playgroud)

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

[
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"variant": "xterm"} }
]
Run Code Online (Sandbox Code Playgroud)

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