怎么解决Mac下sublime打不开iTerm2的问题
短信预约 -IT技能 免费直播动态提醒
本篇内容主要讲解“怎么解决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的问题”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341