# Ghostty support

**URL:** <https://discuss.kakoune.com/t/ghostty-support/2952>\
**Category:** Plugins\
**Created:** [July 29, 2026, 10:18am UTC](https://discuss.kakoune.com/t/ghostty-support/2952 "2026-07-29T10:18:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrworth](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lrworth/32/369_2.png) [@lrworth](https://discuss.kakoune.com/u/lrworth)\
**Post date:** [July 29, 2026, 10:18am UTC](https://discuss.kakoune.com/t/ghostty-support/2952/1 "2026-07-29T10:18:02Z")

</div>

Hi! I’ve been using Kakoune with Ghostty for the past couple of weeks using [this plugin](https://gist.github.com/lrworth/dc78128c88ad2622c567944dbbd70663). It works well but `:focus` only works on the nightly build. Just to spread awareness and rack up internet points.

I have also opened [Support windowing in Ghostty by lrworth · Pull Request #5524 · mawww/kakoune · GitHub](https://github.com/mawww/kakoune/pull/5524) in case someone wants this built-in to Kakoune (otherwise I’d consider packaging the plugin better).

---

<div class="post-metadata">

**Author:** ![alexherbo2](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/alexherbo2/32/1140_2.png) [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Post date:** [July 29, 2026, 4:07pm UTC](https://discuss.kakoune.com/t/ghostty-support/2952/2 "2026-07-29T16:07:37Z")

</div>

I’m wondering if `+new-window` action will be supported on macOS. Zed has `Zed > Install CLI` from the application menu. Something equivalent could be nice for macOS.

---

<div class="post-metadata">

**Author:** ![alexherbo2](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/alexherbo2/32/1140_2.png) [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Post date:** [July 29, 2026, 4:16pm UTC](https://discuss.kakoune.com/t/ghostty-support/2952/3 "2026-07-29T16:16:35Z")

</div>

Is there a way to get the `terminal` associated to `%val{client_pid}`?

Technically, `eval -client kak_client_in_given_ghostty_terminal ghostty-terminal-vertical kak -c %val{session}` should do the correct thing.

> **[AppleScript (macOS) - Features](https://ghostty.org/docs/features/applescript)**
>
> Automate Ghostty on macOS with AppleScript. This guide covers
> the object model, available commands, and practical examples.

---

<div class="post-metadata">

**Author:** ![benjaminwil](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/benjaminwil/32/1657_2.png) [@benjaminwil](https://discuss.kakoune.com/u/benjaminwil)\
**Post date:** [July 29, 2026, 5:44pm UTC](https://discuss.kakoune.com/t/ghostty-support/2952/4 "2026-07-29T17:44:20Z")

</div>

Amazing!

I just added some suggestions for making the pull request more friendly for Linux users. I’ve been using Ghostty with Kakoune on Linux for months now.

It’s a bummer that there’s no CLI options for handling splits, tabs, etc. outside of AppleScript. But creating new windows works for me just fine.

Maybe eventually that will get built out for the Linux people.

---

<div class="post-metadata">

**Author:** ![lrworth](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lrworth/32/369_2.png) [@lrworth](https://discuss.kakoune.com/u/lrworth)\
**Post date:** [July 29, 2026, 11:14pm UTC](https://discuss.kakoune.com/t/ghostty-support/2952/5 "2026-07-29T23:14:54Z")

</div>

Wow, well spotted. I think this is actually impossible to get working in Ghostty 1.3.1 (latest release right now) but nightly gives `terminal` a `tty` property which I used in `ghostty-focus`. I’ll see if I can update so your command works.

---

<div class="post-metadata">

**Author:** ![alexherbo2](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/alexherbo2/32/1140_2.png) [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Post date:** [July 30, 2026, 12:21pm UTC](https://discuss.kakoune.com/t/ghostty-support/2952/6 "2026-07-30T12:21:48Z")

</div>

`tty` PR also comes with a `pid` property that refers to the “PID of the foreground process in this terminal.”, so we can directly match to the `%val{client_pid}` value.

> <https://github.com/ghostty-org/ghostty/pull/11922>
>
> \## Summary
> 
> Add \`pid\` and \`tty\` as read-only properties to:
> \- The AppleScript \`t…erminal\` class
> \- The App Intents \`TerminalEntity\`
> 
> This enables reliable process-to-terminal mapping for automation tools when multiple terminals share the same working directory.
> 
> \## Changes
> 
> \- \`macos/Ghostty.sdef\`: add \`pid\` and \`tty\` to the \`terminal\` class
> \- \`macos/Sources/Features/AppleScript/ScriptTerminal.swift\`: add AppleScript getters
> \- \`macos/Sources/Ghostty/Ghostty.Surface.swift\`: add Swift accessors for foreground PID and PTY name
> \- \`src/apprt/embedded.zig\`: add C bridge exports for foreground PID and PTY name
> \- \`include/ghostty.h\`: declare the new C API entry points
> \- \`macos/Sources/Features/App Intents/Entities/TerminalEntity.swift\`: surface the same values in App Intents
> 
> \## Testing
> 
> \- \`zig build -Demit-macos-app=false\`
> \- \`/opt/homebrew/bin/nu macos/build.nu --configuration Debug --action build\`
> \- \`swiftlint lint 'macos/Sources/Features/AppleScript/ScriptTerminal.swift'\`
> \- \`swiftlint lint 'macos/Sources/Features/App Intents/Entities/TerminalEntity.swift'\`
> \- \`swiftlint lint 'macos/Sources/Ghostty/Ghostty.Surface.swift'\`
> \- AppleScript smoke test against the built app:
> - \`get {id, pid, tty, working directory} of terminal 1\`
> - \`get pid of every terminal\`
> - \`get tty of every terminal\`
> - Verified returned \`pid\`/\`tty\` against \`ps -p \<pid\> -o pid=,tty=,comm=\` and \`lsof -a -p \<pid\> -d cwd -Fn\`
> 
> \## AI Disclosure
> 
> This PR was developed with AI assistance (Codex). The contributor understands the changes and can explain the implementation.
> 
> Closes #11592
> Closes #10756
