Sublime Forum

Newbie question - how do I kill the console process

#1

I’m running Sublime Text 2 on Windows, and set up a build system to run a javascript file using Node - just “node $file”. This works great, and the console shows Node’s console messages.

My question is, how do I kill this process? Either a command or something I can run from within the build system would be fine. Ideally, I’d like the build system to find and kill the previous Node process if it exists, then launch my new one. I’d be happy just to be able to find/kill this process at all, though - and I’m completely new to Python.

Thanks!

0 Likes

#2

You can create a new build system that will not supress GUIs on Windows. The default build system’s command is implemented in Packages/Default/exec.py.

  • You can copy that to a new file (e. g., Packages/User/my_exec.py),
  • rename the exec command (class) inside that file (e. g. MyExecCommand),
  • remove the code that causes new processes to hide their window in MyExecCommand, and then
  • use the target element in a .sublime-build file (“target”: “my_exec”) to use your new command instead of the default one.

For the last step, you can also reuse the Python.sublime-build file found in the Python package and simply add the “target” element.

More info here:

sublimetext.info/docs/en/referen … stems.html

0 Likes

#3

Also, the Tools/Cancel Build menu item may do what you want

0 Likes