ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Console Exec

by Joe Esposito ST2/ST3

Run a Sublime Text command in a console window. Supports both Sublime Text 2 & 3.

Details

Installs

  • Total 15K
  • Win 10K
  • OS X 3K
  • Linux 3K
Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5
Windows 0 5 6 6 2 3 3 6 10 6 4 2 4 3 5 7 6 3 4 1 5 6 6 5 7 9 6 3 3 6 6 8 5 1 0 4 6 4 7 1 6 3 8 4 4 7
OS X 0 1 1 0 1 1 0 3 1 4 0 1 0 1 3 2 2 2 2 0 2 0 1 0 0 0 0 0 2 2 2 3 0 1 3 0 0 1 2 0 0 0 1 1 0 2
Linux 0 2 1 5 2 1 0 2 2 1 0 1 2 3 1 2 1 1 0 5 4 0 0 2 1 1 0 1 1 0 3 0 0 1 0 0 1 0 2 3 2 2 0 0 2 3

Readme

Source
raw.​githubusercontent.​com

Console Exec

Plugin for Sublime Text to execute a command in a console window. After the process exits, the console remains open and displays “Press any key to exit” before closing.

This plugin is based on the exec command shipped with Sublime Text, and uses the launcher that ships with Crimson Editor to wait for a keypress before closing the window.

Running a Flask application screenshot

Source available on Github.

Why?

Aside from personal preference of having an external console in web projects,

  • Sublime leaves your background process running when you quit
  • Rebuilding a project overwrites your running process, leaking processes if you're not careful
  • Certain environments such as Pyglet will not run within the integrated console window

This plugin ties these loose ends in a familiar way.

Usage

In any .sublime-build file add the following line to run it in a console:

"target": "console_exec"

For example, here's a modified Python.sublime-build file:

{
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",
    "target": "console_exec"
}

Note: you can find the appropriate build file from “Browse Packages…”

Installation

With Sublime Package Control, simply

  1. Select Package Control: Install Package from the command palette
  2. Locate ConsoleExec and press enter to install it

Manual installation (advanced)

Clone this repository into the Packages directory. To see where it's located enter print sublime.packages_path() in the console.