Reputation: 483
When I press ctrl + B
in sublime text, it gives unnecessary output like path, dir etc. How to stop this behavior.
Expected:
[Finished in 0.1s with exit code 1]
Getting:
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u .....
[dir:....
[path:....
Just included a excerpt of above, it shows the whole path and looks very cluttered. Moreover, sometimes it shows these other dir path etc, sometimes it doesn't. Also I am not using any packages, just the default v3 and the build system is python.
In addition, this only happens if there's is an error. Otherwise, it behaves as expected like above.
Upvotes: 2
Views: 539
Reputation: 102892
If you are interested in altering how build systems work, you can clone and modify Packages/Default/exec.py
, which is the default program that runs builds. Since you're using ST3, you'll need to install PackageResourceViewer
from Package Control, select PackageResourceViewer: Open Resource
from the Command Palette, then select Default
and exec.py
. Before you do anything, change the name of class ExecCommand
(on line 129 or thereabouts) to something like MyExecCommand
, then use Save As...
to save the file as Packages/User/my_exec.py
so you don't interfere with the default version.
The changes you want are actually fairly simple, you just need to comment out a portion of the code. I'm running Build 3095, and the lines are 207-215 (they may be different in other versions of ST3):
if shell_cmd:
self.debug_text += "[shell_cmd: " + shell_cmd + "]\n"
else:
self.debug_text += "[cmd: " + str(cmd) + "]\n"
self.debug_text += "[dir: " + str(os.getcwd()) + "]\n"
if "PATH" in merged_env:
self.debug_text += "[path: " + str(merged_env["PATH"]) + "]"
else:
self.debug_text += "[path: " + str(os.environ["PATH"]) + "]"
Once you've done that, save the file. Now, open your build system and add:
"target": "my_exec",
to the second line, just after the opening curly brace {
. Verify that everything works as you wish, and that should be it.
Upvotes: 3