forked from baskerville/Common-Lisp.tmbundle
/
Attach to Session.tmCommand
57 lines (53 loc) · 1.46 KB
/
Attach to Session.tmCommand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
CL_SESSION_NAME="lisp"
SESSION_STARTED=`"${TM_TMUX}" list-sessions | grep $CL_SESSION_NAME`
if [ -n "$SESSION_STARTED" ]
then
osascript -e "tell application \"iTerm\"
activate
if ((count of every terminal) is greater than 0) then
set myTerminal to last terminal
else
set myTerminal to (make new terminal)
end if
tell myTerminal
launch session \"Default\"
tell last session
write text \"${TM_TMUX} attach-session -t $CL_SESSION_NAME\"
end tell
end tell
end tell"
growl "Attached!"
else
growl "No server to attach to…"
fi</string>
<key>input</key>
<string>none</string>
<key>inputFormat</key>
<string>text</string>
<key>keyEquivalent</key>
<string>^@></string>
<key>name</key>
<string>Attach to Session</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>text</string>
<key>outputLocation</key>
<string>discard</string>
<key>scope</key>
<string>source.lisp</string>
<key>uuid</key>
<string>6910FCB1-6396-40B9-927B-DBE303034E38</string>
<key>version</key>
<integer>2</integer>
</dict>
</plist>