Diff
1diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
2index fce88c79669f8169b68c8da25aca707c0ba59f96..81eed5e92af372466fc02bb682a9d5a8b26091e8 100644
3--- a/plugins/osx/osx.plugin.zsh
4+++ b/plugins/osx/osx.plugin.zsh
5@@ -1,11 +1,57 @@
6+function savepath() {
7+ pwd > ~/.current_path~
8+}
9+
10 function tab() {
11- osascript 2>/dev/null <<EOF
12+savepath
13+osascript >/dev/null <<EOF
14+on do_submenu(app_name, menu_name, menu_item, submenu_item)
15+ -- bring the target application to the front
16+ tell application app_name
17+ activate
18+ end tell
19 tell application "System Events"
20- tell process "Terminal" to keystroke "t" using command down
21- end
22- tell application "Terminal"
23+ tell process app_name
24+ tell menu bar 1
25+ tell menu bar item menu_name
26+ tell menu menu_name
27+ tell menu item menu_item
28+ tell menu menu_item
29+ click menu item submenu_item
30+ end tell
31+ end tell
32+ end tell
33+ end tell
34+ end tell
35+ end tell
36+ end tell
37+end do_submenu
38+
39+do_submenu("Terminal", "Shell", "New Tab", 1)
40+EOF
41+}
42+
43+function itab() {
44+savepath
45+osascript >/dev/null <<EOF
46+on do_submenu(app_name, menu_name, menu_item)
47+ -- bring the target application to the front
48+ tell application app_name
49 activate
50- do script with command "cd \"$PWD\"; $*" in window 1
51 end tell
52+ tell application "System Events"
53+ tell process app_name
54+ tell menu bar 1
55+ tell menu bar item menu_name
56+ tell menu menu_name
57+ click menu item menu_item
58+ end tell
59+ end tell
60+ end tell
61+ end tell
62+ end tell
63+end do_submenu
64+
65+do_submenu("iTerm", "Shell", "New Tab")
66 EOF
67-}
68+}