搜尋
首頁開發工具sublime解決Mac下sublime打不開iTerm2的問題

下面由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/89
CD_CMD="cd "\\\"$(pwd)\\\"" && clear"
if echo "$SHELL" | grep -E "/fish$" &> /dev/null; then
  CD_CMD="cd "\\\"$(pwd)\\\""; and clear"
fi
VERSION=$(sw_vers -productVersion)
OPEN_IN_TAB=0
while [ "$1" != "" ]; do
    PARAM="$1"
    VALUE="$2"
    case "$PARAM" in
        --open-in-tab)
            OPEN_IN_TAB=1
            ;;
    esac
    shift
done
if (( $(expr $VERSION &#39;<&#39; 10.7) )); then
    RUNNING=$(osascript<<END
    tell application "System Events"
        count(processes whose name is "iTerm")
    end tell
END
)
else
    RUNNING=1
fi
if (( ! $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 tell
END
else
    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 tell
EOF
    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 tell
EOF
    fi
fi

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

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

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

以上是解決Mac下sublime打不開iTerm2的問題的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文轉載於:crossingmay。如有侵權,請聯絡admin@php.cn刪除
sublime怎麼運行sublime怎麼運行Apr 16, 2025 am 09:39 AM

要運行 Sublime Text,需要下載、安裝應用程序、購買許可證(可選),然後啟動應用程序。新建或打開文件,即可開始編碼。

sublime怎麼漢化sublime怎麼漢化Apr 16, 2025 am 09:36 AM

Sublime Text 可以通過以下步驟漢化:1. 下載漢化包;2. 安裝漢化包;3. 重啟 Sublime Text;4. 設置默認語言(可選);5. 校驗漢化。

sublime插件怎麼刪除sublime插件怎麼刪除Apr 16, 2025 am 09:33 AM

刪除 Sublime Text 中的插件有兩種方法:通過插件管理器刪除:選擇要刪除的插件並右鍵點擊,選擇 "刪除"。手動刪除:導航到用戶數據目錄,找到插件文件夾並將其拖到回收站或廢紙簍中。

sublime怎麼用gbk寫代碼sublime怎麼用gbk寫代碼Apr 16, 2025 am 09:30 AM

在 Sublime Text 中使用 GBK 編碼編寫代碼,需要:1. 設置項目編碼為 GBK;2. 新建文件;3. 另存為時選擇 GBK 編碼;4. 使用 GBK 編碼輸入代碼。

sublime怎麼改為漢語sublime怎麼改為漢語Apr 16, 2025 am 09:27 AM

sublime 可翻譯成中文為:1. 崇高的,神聖的;2. 極好的,非凡的;3. 難以形容的,令人敬畏的;4. 崇高的思想。

sublime怎麼獲取註冊碼sublime怎麼獲取註冊碼Apr 16, 2025 am 09:24 AM

購買 Sublime Text 註冊碼的步驟如下:訪問網站並選擇“購買”。選擇許可證類型並輸入信息。付款並接收包含註冊碼的電子郵件。打開 Sublime Text,轉到“許可證”菜單並粘貼註冊碼。單擊“註冊”以激活您的註冊碼和高級功能。

sublime怎麼保存代碼sublime怎麼保存代碼Apr 16, 2025 am 09:21 AM

Sublime Text 提供多種保存代碼的方法,包括快捷鍵(Ctrl S)、菜單欄(File > Save)、工具欄(磁盤圖標)和命令面板(Ctrl P)。此外,它還提供自動保存功能,可以定期自動保存打開的文件。

sublime怎麼用箭頭函數sublime怎麼用箭頭函數Apr 16, 2025 am 09:18 AM

使用箭頭函數可以簡潔且快速地在 Sublime Text 中定義匿名函數,語法為:(參數列表) => 表達式,優點包括簡潔性、可讀性、作用域繼承和閉包功能,注意事項包括擴展運算符和 this 關鍵字限制,以及多行函數需要明確的 return 語句。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 個月前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
1 個月前By尊渡假赌尊渡假赌尊渡假赌
威爾R.E.P.O.有交叉遊戲嗎?
1 個月前By尊渡假赌尊渡假赌尊渡假赌

熱工具

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具