ghostty-applescript

Generates AppleScript layout automation scripts for Ghostty terminal windows, tabs, and pane splits.

Updated May 20, 2026
One-click install
npx skills add https://github.com/TeXmeijin/agent-skills --skill ghostty-applescript-texmeijin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ghostty-applescript
Source: https://github.com/TeXmeijin/agent-skills/tree/main/.apm/skills/ghostty-applescript
Command: npx skills add https://github.com/TeXmeijin/agent-skills --skill ghostty-applescript-texmeijin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing AppleScript for Ghostty's terminal automation API is error-prone because return types are poorly documented and wrong prepositions cause silent failures or cryptic errors. This Skill encodes the correct object hierarchy, return-type conversions, and syntax rules so generated layout scripts work on the first run. ## Core Features & Use Cases - Correct Return-Type Handling: Converts tab and window objects to terminals via focused terminal of before calling split or input text, avoiding the most common crash patterns. - Layout Pattern Library: Provides ready-made patterns for 2x3 grids, multi-tab splits, and split equalization using perform action "equalize_splits". - Zellij KDL Conversion: Maps Zellij layout concepts (tabs, panes, split directions, commands) to equivalent Ghostty AppleScript constructs. - Use Case: You want a script that opens Ghostty with a 2x3 pane grid, runs vim in one pane and lazygit in another, all in your project directory. This Skill generates the correct .applescript file runnable via osascript. ## Quick Start Write a Ghostty AppleScript that opens a new tab in my project directory, splits it into a 2x3 grid, and runs vim in the top-left pane.

Frequently Asked Questions about ghostty-applescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write an AppleScript to split panes in Ghostty terminal?

Use `split terminal direction right with configuration cfg` where direction is a bare keyword (right, left, down, up) without quotes. You must call split on a terminal object, not a tab, so convert tabs first with `focused terminal of theTab`.

How to automate Ghostty terminal layout with AppleScript?

Create a surface configuration with your working directory, open a window or tab with that configuration, get the focused terminal, then chain split commands and use `input text "cmd" & return to terminal` to run commands. Execute the script with `osascript layout.applescript`.

Why does Ghostty AppleScript split fail with 'not in a splittable window'?

This error occurs because `new tab` returns a tab object, not a terminal, and tabs cannot receive split commands. Fix it by converting with `set t to focused terminal of newTab` before calling split, and avoid re-querying `terminal 1 of selected tab`.

Can I convert Zellij KDL layouts to Ghostty AppleScript?

Yes, Zellij tabs map to `new tab in window`, vertical splits to `split direction right`, and horizontal splits to `split direction down`. Exact pane size ratios are not supported, so use `perform action "equalize_splits"` to even out panes instead.

Does Ghostty AppleScript support setting working directory per pane?

Yes, set `initial working directory` on a new surface configuration and pass it to each split or tab command. Working directory inheritance on split is undocumented, so always pass a configuration explicitly to each new pane.