Well, I finally found a solution that runs the build system in the xterm external terminal. If you use this Sublime, you open the xterm window and start the build system there. This window remains open, i.e. Matlab graph windows will not be closed after code execution. I combined the build system with and without an 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');\""] } ] }
and then assigned a user key binding to access the xterm variant easily:
[ { "keys": ["ctrl+shift+b"], "command": "build", "args": {"variant": "xterm"} } ]
This xterm solution should also work with any other interpreter that you want to prevent closing after completion of the code.
source share