2025年6月16日 星期一 农历 本月21日夏至 免费收录 快速收录 最新收录 TAGS 工具大全
首页/ > 分享资讯/ > 开发工具

解决Mac下sublime打不开iTerm2的问题

时间:2023-11-06 15:57:31人气:4次 栏目:开发工具
【导读】:四眼客目录在线提供,解决Mac下sublime打不开iTerm2的问题开发工具爱好者免费阅读。本文地址:http://www.ooooke.com/soft/129.html
下面由sublime教程栏目给大家介绍如何解决Mac下sublime打不开iTerm2的问题,希望对需要的朋友有所帮助!

修复Mac下subllime中无法打开iTerm2问题

貌似升级了iTerm2到v3以后就出来这个问题了。在sublime中使用快捷键无法打开iTerm2。但是去除用户设定以后,可以在系统默认的terminal中打开。

具体解决如下:

iTerm 版本:

解决Mac下sublime打不开iTerm2的问题

打开

解决Mac下sublime打不开iTerm2的问题

找到terminal>iTerm.sh

编辑iTerm,把如下内容替换进去。

#!/bin/bash# Modified following this issue: https://github.com/wbond/sublime_terminal/issues/89CD_CMD="cd "///"$(pwd)///"" && clear"if echo "$SHELL" | grep -E "/fish$" &> /dev/null; then  CD_CMD="cd "///"$(pwd)///""; and clear"fiVERSION=$(sw_vers -productVersion)OPEN_IN_TAB=0while [ "$1" != "" ]; do    PARAM="$1"    VALUE="$2"    case "$PARAM" in        --open-in-tab)            OPEN_IN_TAB=1            ;;    esac    shiftdoneif (( $(expr $VERSION '<' 10.7) )); then    RUNNING=$(osascript<<END    tell application "System Events"        count(processes whose name is "iTerm")    end tellEND)else    RUNNING=1fiif (( ! $RUNNING )); then    osascript<<END    tell application "iTerm"            tell current window                tell current session of (create tab with default profile)                    write text "$CD_CMD"                end tell            end tell            activate    end tellENDelse    if (( $OPEN_IN_TAB )); then        osascript &>/dev/null <<EOF        tell application "iTerm"                    if (count of windows) = 0 then                        set theWindow to (create window with default profile)                        set theSession to current session of theWindow                    else                        set theWindow to current window                        tell current window                            set theTab to create tab with default profile                            set theSession to current session of theTab                        end tell                    end if                    tell theSession                        write text "$CD_CMD"                    end tell                    activate        end tellEOF    else        osascript &>/dev/null <<EOF        tell application "iTerm"                    tell (create window with default profile)                        tell the current session                            write text "$CD_CMD"                        end tell                    end tell                    activate        end tellEOF    fifi

记得这里的用户设置为(Sublime Text -> Preferences -> Package Settings -> Terminal -> Settings-User)

{  "terminal": "iTerm.sh",  "parameters": ["open_terminal_project_folder"]}

这样,我们又可以愉快的在sublime里启动iTerm2了!

标签:

版权声明:

1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

2、本站仅提供信息发布平台,不承担相关法律责任。

3、若侵犯您的版权或隐私,请联系本站管理员删除。

4、文章来源:本文由会员转载自互联网,如果您是文章原创作者,请联系本站注明您的版权信息。

网站公告 关于我们 版权申明 网站地图
Copyright © 2025 ooooke.com 浙ICP备15022117-2号