Sublime Forum

Running Command Prompt commands from Sublime's Console

#1

I realize that Sublime’s Console runs Python code. However, I work in Erlang that deals with command prompt and would like to be able to type the commands directly into the console to run it, for example, typing this into Console:

run(“erl -run foo -run foo bar -run foo bar baz 1 2”)

Console will capture output of command prompt and display out.

I saw some people has written plugin for it, but since commands need arguments, using hotkey will not work in this case.

0 Likes

#2

+1

A while ago I suggested a similar feature https://forum.sublimetext.com/t/ad-hoc-tool-integration/881/1.

I am using a lot of different command-line tools that output file locations e.i. file name and line no. I added some of these tools to the build menu, but it didn’t really work me, because I often tweak these commands with command-line arguments and options. So I abandoned this approach after I’ve added more than 20 basic command-line combinations to the build menu.

At the moment, I am just using one “build” command (Replay.sublime-build).

build cmd.exe /C type output
lineNumberRegex
showWhenFinished true
workingDir $ProjectDir

I use this command to replay the output from the last shell command I ran outside Sublime. This actually works reasonable well for me, but I still believe that Sublime is missing a tool panel that would allow us to type in ad-hoc commands (see my last post).

0 Likes

#3

Sorry, I just realized that I forgot to write an output filter (lineNumberRegex) for the Replay command. The whole point of Replay is of cause to add an output filter :wink:

0 Likes

#4

Yeah, I’m just using one Build command for now. It’s just for compiling the source. But in order to test the code, I would need arguments. I can’t write tons of build files just to test my code.

0 Likes