本篇内容主要讲解“怎么解决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"]}
到此,相信大家对“怎么解决Mac下sublime打不开iTerm2的问题”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!