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 13K
  • Win 8K
  • OS X 2K
  • Linux 3K
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 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
Windows 1 11 5 7 11 9 4 8 8 8 5 7 6 7 6 5 6 4 10 4 6 7 7 8 5 7 6 6 8 7 9 8 6 3 1 15 7 14 7 9 4 7 9 9 6 7
OS X 1 2 1 2 2 1 2 1 0 3 1 2 1 1 5 2 1 1 3 0 0 4 4 1 1 2 2 2 2 3 1 1 2 0 0 1 1 2 1 3 2 2 2 0 5 2
Linux 1 1 3 5 2 1 2 1 2 2 0 2 0 1 3 1 4 6 0 4 5 1 2 1 3 1 1 1 3 1 2 1 4 0 1 1 4 4 3 2 1 4 5 3 7 1

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.