从Sublime Text打开项目到iTerm的新标签页(不是新窗口)

时间:2014-12-15 10:54:45

标签: sublimetext iterm

我一直在使用Terminal软件包从Sublime Text快速打开终端。唯一的问题是它将它打开到iTerm中的新窗口,而不是新选项卡。

有没有办法强制它打开新标签?

来自docs

  

使用open_terminal和open_terminal_project_folder命令的参数参数,可以构建自定义终端环境。

我可以以某种方式使用"参数"在完成此任务的环境中?

这是默认设置:

{
    // 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": []
}

2 个答案:

答案 0 :(得分:2)

编辑Packages / Terminal文件夹中的iTerm.sh

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

它对我有用

答案 1 :(得分:2)

您可以像这样配置终端包设置:

{
    // 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"]
}