Sublime Forum

Run_command without showing output

#1

Is there a way for me to use run_command without it opening an output display at the bottom of my window?

I’m using the Hooks plugin to process files after each save, and having this little output pane appear each time is bothersome. (I’ve found this old doc http://www.sublimetext.com/docs/1/commands, but I can’t find the pertinent page in the current version.)

0 Likes

#2

Commands in general don’t have any output. It would help to share what you’re trying to do. There’s a full-ish list of commands here: https://docs.sublimetext.io/reference/commands.html

0 Likes

#3

Thanks. Suppose I’m trying to run this:

window.run_command("exec", {"cmd": ["bash", "-c", "echo foo"]})

See screenshot:

![y|690x122]

I end up with some output (which I’ll try to put in a screenshot in my next post because new users are allowed only one screenshot per post).

I reality, though, my goal is to trigger a bash script when any file is saved, and the bash script considers some criteria, then may decide to transmit the file to a server. In this case too, I get the same output pane, which I’d like to suppress.

0 Likes

#4

Here’s the output:

I’ve tried out the quiet option from the doc, but that doesn’t suppress output on a successful execution.

0 Likes

#5

The quiet argument stops the build from displaying the build time and it blocks error diagnostics when the build command fails. If you want exec to not open the panel, you need to change the value of this setting, shown here with it’s default value:

	// Shows the Build Results panel when building. If set to false, the Build
	// Results can be shown via the Tools/Build Results menu.
	"show_panel_on_build": true,

This will also affect build systems as well. If you also use build systems and want to see the panel there, then you need a simple plugin that implements a version of exec that doesn’t display the panel.

The following video shows how to do that (and the description has a link to the example plugins):

1 Like

#6

Wow, thanks!

0 Likes