MacTerminal is a SublimeText plugin. It opens new Terminal tab (on current or new window if necessary). It's working with Terminal and iTerm.
Python JavaScript AppleScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
messages
.gitignore
.no-sublime-package
Default.sublime-commands
Default.sublime-keymap
Main.sublime-menu
README.md
Side Bar.sublime-menu
messages.json
open_termx_terminal.py
termX.sublime-settings
termx_iterm.js
termx_iterm.scpt
termx_terminal.js
termx_terminal.scpt

README.md

Sublime Text terminal plugin for macs

  1. Fully packaged
  2. Currently with option to open new tab
  3. Sublime Text 2 and 3

Installation

From git:

cd $PATH_OF_SUBLIME_PACKAGES
git clone git://github.com/afterdesign/termX.git

From package control

Just type termX

Keybinding

Default keybinding is:

ctrl+cmd+t

To change it go to:

Sublime Text 2 -> Preferences -> Package Settings -> termX -> Key Bindings - User

And set something similar to:

{ "keys": ["super+t"], "command": "open_termx_terminal" }

iTerm 2 (v3 - current stable) support

By default this plugin is using native Terminal.app but iTerm2 is way cooler so download it. To change settings edit:

Sublime Text 2 -> Preferences -> Package Settings -> termX -> Settings - User

And change terminal setting to iterm (default is terminal):

{
    "terminal"   :  "terminal/iterm"
}

Terminal opening strategy

By default termX is opening terminal with path to directory where currently edited file is placed.

You can change this behavious by editing settings file:

Sublime Text 2 -> Preferences -> Package Settings -> termX -> Settings - User

Default option is file and you can change it to project:

{
    directory_mode" : "file/project"
}

FAQ

  1. The "Open in terminal" is greyed out. This happens when there is no opened file and for now I don't know if this is just a sublime bug or I need to change something. For now I saw the same behavior in

  2. How do I change path to osascript ?

    To check what is path for osascript just open terminal and type:

    which osascript
    

    With path simply go to:

    Sublime Text 2 -> Preferences -> Package Settings -> termX -> Settings - User
    

    and add:

    {
        "osascript"   :  "/usr/bin/osascript"
    }
    
  3. Can I always open main directory of project ?

    From version 2.0 you can.

    Open:

    Sublime Text 2 -> Preferences -> Package Settings -> termX -> Settings - User
    

    And set :

    {
        "directory_mode" : "project"
    }
    

    From now on if you have only 1 directory added to project it's going to be opened by default. If you have more than 1 directory in your project you'll see quickpanel to select what you would like to open.

    Thanks @dirajkumar for the idea !

  4. Its not working for me.

    First of all enable debug mode. To do this open your settings and add: "debug": true

    After this try to open terminal again. If it's not working (and debug shouldn't repair the problem) open sublime console (default shortcut is ctrl+`) and open new issue with log between ---termX Debug Start--- and ---termX Debug End---.

    You can always ping me on twitter or simply write issue on github.

Contact

You can ping or follow me on twitter: @afterdesign

License

Licensed under the MIT license.