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