iTerm2 v3은 많이 개선 된 애플 스크립트 지원을 제공합니다, 그래서 당신은 이제 키 입력을 보내지 않고도 직접 탭을 만들 수 있습니다 : 당신이 를 눌러 얻을 것 같은
tab() {
osascript &>/dev/null <<EOF
tell application "iTerm"
activate
tell current window to set tb to create tab with default profile
tell current session of current window to write text "pwd"
end tell
EOF
}
은 (수평으로 새 탭을 분리하기 위해 ⇧⌘ D), 추가
:
tell current session of current window to split horizontally with same profile
이 분할 (새 탭의 아래쪽 절반)에 의해 생성 된 새로운 세션에 pwd
를 작성하려면
tab() {
osascript &>/dev/null <<EOF
tell application "iTerm"
activate
tell current window to set tb to create tab with default profile
tell current session of current window to set newSplit to split horizontally with same profile
tell newSplit
select
write text "pwd"
end tell
end tell
EOF
}
Script Editor.app
을 열어 iTerm.app
을 선택하십시오.
또한 Terminal.app
및 iTerm2.app
에 대한 고급 기능과 함께 탭/창 작성 패키지 인 CLI (내재 된 탭 분할은 지원하지 않음)를 고려하십시오.