greptile 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/greptile-fix.applescript +24 -2
- package/package.json +1 -1
package/greptile-fix.applescript
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
-- 1. macOS sends us the greptile:// URL
|
|
7
7
|
-- 2. We call greptile-fix CLI to parse the URL, resolve the repo path, and create a runner script
|
|
8
8
|
-- 3. greptile-fix prints the runner script path to stdout
|
|
9
|
-
-- 4. We detect the user's terminal and
|
|
9
|
+
-- 4. We detect the user's terminal and execute the runner script in it
|
|
10
10
|
|
|
11
11
|
on open location theURL
|
|
12
12
|
try
|
|
@@ -44,7 +44,29 @@ on open location theURL
|
|
|
44
44
|
end repeat
|
|
45
45
|
end if
|
|
46
46
|
end try
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
do shell script "echo 'Detected terminal: " & termApp & "' >> /tmp/greptile-fix.log"
|
|
49
|
+
|
|
50
|
+
-- Terminal-specific launch commands for macOS.
|
|
51
|
+
-- "open -a <app> <script>" only works for Terminal.app and iTerm which
|
|
52
|
+
-- natively execute scripts passed this way. Other terminals need explicit flags.
|
|
53
|
+
-- References:
|
|
54
|
+
-- Ghostty: https://github.com/ghostty-org/ghostty/discussions/5739
|
|
55
|
+
-- kitty: https://sw.kovidgoyal.net/kitty/invocation/
|
|
56
|
+
-- WezTerm: https://wezterm.org/cli/start.html
|
|
57
|
+
-- Alacritty: https://man.archlinux.org/man/alacritty.1
|
|
58
|
+
if termApp is "Ghostty" then
|
|
59
|
+
do shell script "open -na Ghostty --args -e " & quoted form of runnerPath & " &>/dev/null &"
|
|
60
|
+
else if termApp is "kitty" then
|
|
61
|
+
do shell script "open -na kitty --args " & quoted form of runnerPath & " &>/dev/null &"
|
|
62
|
+
else if termApp is "WezTerm" then
|
|
63
|
+
do shell script "open -na WezTerm --args start -- " & quoted form of runnerPath & " &>/dev/null &"
|
|
64
|
+
else if termApp is "Alacritty" then
|
|
65
|
+
do shell script "open -na Alacritty --args -e " & quoted form of runnerPath & " &>/dev/null &"
|
|
66
|
+
else
|
|
67
|
+
-- Terminal.app, iTerm, and Warp natively execute scripts via "open -a"
|
|
68
|
+
do shell script "open -a " & quoted form of termApp & " " & quoted form of runnerPath
|
|
69
|
+
end if
|
|
48
70
|
end if
|
|
49
71
|
on error errMsg
|
|
50
72
|
do shell script "echo '[ERROR] " & quoted form of errMsg & "' >> /tmp/greptile-fix.log"
|