0

I've been using the Terminal package to quickly open terminal from Sublime Text. Only problem is that it opens it to a new window in iTerm, not to a new tab.

Is there a way to force it to open to a new tab?

From the docs:

With the parameters argument to the open_terminal and open_terminal_project_folder commands, it is possible to construct custom terminal environments.

Can I somehow use the "parameters" in the setting to accomplish this?

Here's the default settings:

{
    // The command to execute for the terminal, leave blank for the OS default
    // On OS X the terminal can be set to iTerm.sh to execute iTerm
    "terminal": "iTerm.sh",

    // A list of default parameters to pass to the terminal, this can be
    // overridden by passing the "parameters" key with a list value to the args
    // dict when calling the "open_terminal" or "open_terminal_project_folder"
    // commands
    "parameters": []
}
any_h
  • 530
  • 3
  • 10
  • 27
  • I have just found this PR that should solve this :) https://github.com/wbond/sublime_terminal/pull/69 – any_h Dec 15 '14 at 15:33
  • After investigating more, I found out that MacTerminal package does this by default https://sublime.wbond.net/packages/MacTerminal – any_h Dec 15 '14 at 15:42

2 Answers2

2

Edit the iTerm.sh in Packages/Terminal folder

if (( $RUNNING )); then
    osascript<<END
    tell application "iTerm"
        activate
        tell the first terminal
            set sess to (launch session "Default Session")
            tell sess
                write text "$CD_CMD"
            end tell
        end tell
    end tell
END

it works for me

bummi
  • 27,123
  • 14
  • 62
  • 101
dswwsd
  • 133
  • 5
2

You can config Terminal Package Setting like this:

{
    // The command to execute for the terminal, leave blank for the OS default
    // On OS X the terminal can be set to iTerm.sh to execute iTerm
    "terminal": "iTerm.sh",

    // A list of default parameters to pass to the terminal, this can be
    // overridden by passing the "parameters" key with a list value to the args
    // dict when calling the "open_terminal" or "open_terminal_project_folder"
    // commands
    "parameters": ["--open-in-tab"]
}
kk17
  • 601
  • 6
  • 14