好吧,我终于找到了一个在外部 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');\""]
}
]
}
然后分配一个用户键绑定以轻松访问 xterm 变体:
[
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"variant": "xterm"} }
]
此 xterm 解决方案还应该与您希望防止在代码执行完成后关闭的任何其他解释器一起使用。