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