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

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.