ac1335125cb7fe742d825a95bb288ff8a8bfadd9

Author
Adil Erchouk <adilrc@icloud.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(macos): add support for Ghostty (#12890)

Diff

 1diff --git a/plugins/macos/README.md b/plugins/macos/README.md
 2index 8245e211f450913f1ce8624c65b6763ff241a37e..ccc4331e589f4906b0179356c4069599fb77f223 100644
 3--- a/plugins/macos/README.md
 4+++ b/plugins/macos/README.md
 5@@ -13,6 +13,7 @@ plugins=(... macos)
 6 - [iTerm2](https://iterm2.com/)
 7 - [Hyper](https://hyper.is/)
 8 - [Tabby](https://tabby.sh/)
 9+- [Ghostty](https://ghostty.org)
10 
11 ## Commands
12 
13diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh
14index b951a289f4426073bbbaa50eebb3ad5054659076..6ddf31ecf05db9675cea531fdee0ed72c74f9c85 100644
15--- a/plugins/macos/macos.plugin.zsh
16+++ b/plugins/macos/macos.plugin.zsh
17@@ -85,6 +85,12 @@ EOF
18       tell application "System Events"
19         tell process "Tabby" to keystroke "t" using command down
20       end tell
21+EOF
22+  elif [[ "$the_app" == 'ghostty' ]]; then
23+    osascript >/dev/null <<EOF
24+      tell application "System Events"
25+        tell process "Ghostty" to keystroke "t" using command down
26+      end tell
27 EOF
28   else
29     echo "$0: unsupported terminal app: $the_app" >&2
30@@ -139,6 +145,12 @@ EOF
31       tell application "System Events"
32         tell process "Tabby" to keystroke "D" using command down
33       end tell
34+EOF
35+  elif [[ "$the_app" == 'ghostty' ]]; then
36+    osascript >/dev/null <<EOF
37+      tell application "System Events"
38+        tell process "Ghostty" to keystroke "D" using command down
39+      end tell
40 EOF
41   else
42     echo "$0: unsupported terminal app: $the_app" >&2
43@@ -194,6 +206,12 @@ EOF
44       tell application "System Events"
45         tell process "Tabby" to keystroke "d" using command down
46       end tell
47+EOF
48+  elif [[ "$the_app" == 'ghostty' ]]; then
49+    osascript >/dev/null <<EOF
50+      tell application "System Events"
51+        tell process "Ghostty" to keystroke "d" using command down
52+      end tell
53 EOF
54   else
55     echo "$0: unsupported terminal app: $the_app" >&2