Добрый день!
В настоящее время я пытаюсь заставить работать следующий псевдоним. 'git_fetch' и 'git_tree' являются пользовательскими псевдонимами, поэтому не беспокойтесь о них.
alias git_workspace='osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear && git_fetch\" in selected tab of the front window" -e 'end tell' &> /dev/null && osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear && git_tree\" in selected tab of the front window" -e 'end tell' &> /dev/null' (Я добавил разрывы строк, чтобы улучшить читаемость)
alias git_workspace='osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear && git_fetch\" in selected tab of the front window" -e 'end tell' &> /dev/null && osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "n" using command down' -e "do script with command \"cd `pwd`;clear && git_tree\" in selected tab of the front window" -e 'end tell' &> /dev/null' Однако я не могу заставить это работать. Перезагрузка ~ / .profile приводит к:
-bash: alias: application: not found -bash: alias: Terminal -e tell: not found -bash: alias: application: not found -bash: alias: System Events: not found -bash: alias: to: not found -bash: alias: tell: not found -bash: alias: process: not found -bash: alias: Terminal: not found -bash: alias: to: not found -bash: alias: keystroke: not found -bash: alias: n: not found -bash: alias: using: not found -bash: alias: command: not found -bash: alias: down -e "do script with command \"cd `pwd`;clear && git_fetch\" in selected tab of the front window" -e end: not found -bash: alias: tell &> /dev/null && osascript -e tell: not found -bash: alias: application: not found -bash: alias: Terminal -e tell: not found -bash: alias: application: not found -bash: alias: System Events: not found -bash: alias: to: not found -bash: alias: tell: not found -bash: alias: process: not found -bash: alias: Terminal: not found -bash: alias: to: not found -bash: alias: keystroke: not found -bash: alias: n: not found -bash: alias: using: not found -bash: alias: command: not found -bash: alias: down -e "do script with command \"cd `pwd`;clear && git_tree\" in selected tab of the front window" -e end: not found -bash: alias: tell &> /dev/null: not found Может ли кто-нибудь помочь мне? :)
РЕДАКТИРОВАТЬ : Я нашел решение!
alias git_workspace='osascript -e "tell application \"Terminal\"" -e "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"n\" using command down" -e "do script with command \"cd `pwd`;clear && git_fetch\" in selected tab of the front window" -e "end tell" &> /dev/null && osascript -e "tell application \"Terminal\"" -e "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"n\" using command down" -e "do script with command \"cd `pwd`;clear && git_tree\" in selected tab of the front window" -e "end tell" &> /dev/null'
Я нашел решение! Привязывайся ко всему, что может быть изучено.