greptile 2.2.4 → 2.2.5

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.
@@ -14,55 +14,42 @@ on open location theURL
14
14
  set runnerPath to do shell script "PATH=/opt/homebrew/bin:/usr/local/bin:$PATH greptile-fix " & quoted form of theURL & " 2>> /tmp/greptile-fix.log"
15
15
 
16
16
  if runnerPath is not "" then
17
- -- Detect terminal app: prefer frontmost if it's a terminal, else first running terminal, else Terminal.app
17
+ -- Detect terminal by checking running processes via shell (no accessibility permissions needed).
18
+ -- Check non-default terminals first; fall back to Terminal.app.
18
19
  set termApp to "Terminal"
19
- set knownTerminals to {"iTerm2", "Ghostty", "Warp", "kitty", "WezTerm", "Alacritty", "Terminal"}
20
- -- Map process names to the app name expected by "open -a"
21
- -- (iTerm2's process name is "iTerm2" but the app name is "iTerm")
22
- set termAppNames to {"iTerm", "Ghostty", "Warp", "kitty", "WezTerm", "Alacritty", "Terminal"}
23
20
  try
24
- tell application "System Events"
25
- set frontName to name of first application process whose frontmost is true
26
- set runningApps to name of every application process whose background only is false
27
- end tell
28
- -- If the frontmost app is a known terminal, use it
29
- set foundFront to false
30
- repeat with i from 1 to count of knownTerminals
31
- if frontName is equal to item i of knownTerminals then
32
- set termApp to item i of termAppNames
33
- set foundFront to true
34
- exit repeat
35
- end if
36
- end repeat
37
- -- Otherwise pick the first running terminal we recognize
38
- if not foundFront then
39
- repeat with i from 1 to count of knownTerminals
40
- if item i of knownTerminals is in runningApps then
41
- set termApp to item i of termAppNames
42
- exit repeat
43
- end if
44
- end repeat
21
+ set ps to do shell script "ps -eo comm= 2>/dev/null"
22
+ if ps contains "/Ghostty.app/" then
23
+ set termApp to "Ghostty"
24
+ else if ps contains "/iTerm.app/" then
25
+ set termApp to "iTerm"
26
+ else if ps contains "/Warp.app/" then
27
+ set termApp to "Warp"
28
+ else if ps contains "/kitty.app/" then
29
+ set termApp to "kitty"
30
+ else if ps contains "/WezTerm.app/" then
31
+ set termApp to "WezTerm"
32
+ else if ps contains "/Alacritty.app/" then
33
+ set termApp to "Alacritty"
45
34
  end if
46
35
  end try
47
36
 
48
37
  do shell script "echo 'Detected terminal: " & termApp & "' >> /tmp/greptile-fix.log"
49
38
 
50
39
  -- 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
40
+ -- Ghostty/kitty/WezTerm/Alacritty close the window when the -e command exits,
41
+ -- so we launch bash and source the runner script to keep the shell session alive
42
+ -- after the IDE command (claude/codex/cursor) finishes.
43
+ -- Unset CLAUDECODE so the new session doesn't think it's nested inside an existing one.
44
+ set cleanEnv to "unset CLAUDECODE; source " & quoted form of runnerPath & " ; exec bash"
58
45
  if termApp is "Ghostty" then
59
- do shell script "open -na Ghostty --args -e " & quoted form of runnerPath & " &>/dev/null &"
46
+ do shell script "open -na Ghostty --args -e bash -c '" & cleanEnv & "' &>/dev/null &"
60
47
  else if termApp is "kitty" then
61
- do shell script "open -na kitty --args " & quoted form of runnerPath & " &>/dev/null &"
48
+ do shell script "open -na kitty --args bash -c '" & cleanEnv & "' &>/dev/null &"
62
49
  else if termApp is "WezTerm" then
63
- do shell script "open -na WezTerm --args start -- " & quoted form of runnerPath & " &>/dev/null &"
50
+ do shell script "open -na WezTerm --args start -- bash -c '" & cleanEnv & "' &>/dev/null &"
64
51
  else if termApp is "Alacritty" then
65
- do shell script "open -na Alacritty --args -e " & quoted form of runnerPath & " &>/dev/null &"
52
+ do shell script "open -na Alacritty --args -e bash -c '" & cleanEnv & "' &>/dev/null &"
66
53
  else
67
54
  -- Terminal.app, iTerm, and Warp natively execute scripts via "open -a"
68
55
  do shell script "open -a " & quoted form of termApp & " " & quoted form of runnerPath
package/health-server.js CHANGED
@@ -22,7 +22,7 @@ function selfCheck() {
22
22
  }
23
23
  }
24
24
 
25
- const ALLOWED_ORIGINS = ['https://app.greptile.com', 'https://staging.greptile.com', 'http://localhost:3000']
25
+ const ALLOWED_ORIGINS = ['https://app.greptile.com', 'https://app.staging.greptile.com', 'http://localhost:3000']
26
26
 
27
27
  const server = http.createServer((req, res) => {
28
28
  const origin = req.headers.origin || ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greptile",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "Bridge for Greptile code review 'Fix in Claude Code' and 'Fix in Codex' links",
5
5
  "bin": {
6
6
  "greptile-fix": "bin/greptile-fix.js"