From 058278dc050fffe975cf7ef8049204a651c825e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paal=20=C3=98ye-Str=C3=B8mme?= Date: Wed, 28 Oct 2026 18:09:43 +0100 Subject: [PATCH 1/2] content/script: document name override property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-By: Google Gemini 4 Argon (Medium) Assisted-By: Antigravity CLI 1.4.9 Signed-off-by: Paal Øye-Strømme --- docs/features/applescript.mdx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/features/applescript.mdx b/docs/features/applescript.mdx index 0e235294..455e6528 100644 --- a/docs/features/applescript.mdx +++ b/docs/features/applescript.mdx @@ -45,8 +45,8 @@ application -> windows -> tabs -> terminals | ------ | -------------- | ------------ | | `application` | `name`, `frontmost`, `front window`, `version` | `windows`, `terminals` | | `window` | `id`, `name`, `selected tab` | `tabs`, `terminals` | -| `tab` | `id`, `name`, `index`, `selected`, `focused terminal` | `terminals` | -| `terminal` | `id`, `name`, `working directory` | None | +| `tab` | `id`, `name`, `index`, `selected`, `focused terminal`, `name override` | `terminals` | +| `terminal` | `id`, `name`,`working directory`, `name override` | None | `front window` returns the frontmost Ghostty window. `focused terminal` returns the active terminal in a tab, which is useful for scripts that @@ -215,11 +215,13 @@ tell application "Ghostty" end tell ``` -### Set Tab Titles +### Set Tab and Terminal Titles -Use `perform action` with `set_tab_title` to label tabs from a script. +Both `tab` and `terminal` objects expose a read-write `name override` property. +Setting it overrides the automatically reported title, and setting it to an +empty string (`""`) clears the override. -An example of creating a new tab and setting the title: +An example of creating a new tab and setting its title override: ```AppleScript tell application "Ghostty" @@ -227,9 +229,8 @@ tell application "Ghostty" set cfg to new surface configuration set t1 to new tab in win with configuration cfg - perform action "set_tab_title:Editor" on focused terminal of t1 + set name override of t1 to "Editor" input text "nvim .\n" to focused terminal of t1 - end tell ``` From c4f384023644c1c585d00113b3a0c51c5763d679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paal=20=C3=98ye-Str=C3=B8mme?= Date: Wed, 28 Oct 2026 18:19:16 +0100 Subject: [PATCH 2/2] content/applescript: format markdown tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paal Øye-Strømme --- docs/features/applescript.mdx | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/features/applescript.mdx b/docs/features/applescript.mdx index 455e6528..451241dc 100644 --- a/docs/features/applescript.mdx +++ b/docs/features/applescript.mdx @@ -41,12 +41,12 @@ Ghostty's AppleScript model is hierarchical: application -> windows -> tabs -> terminals ``` -| Object | Key Properties | Key Elements | -| ------ | -------------- | ------------ | -| `application` | `name`, `frontmost`, `front window`, `version` | `windows`, `terminals` | -| `window` | `id`, `name`, `selected tab` | `tabs`, `terminals` | -| `tab` | `id`, `name`, `index`, `selected`, `focused terminal`, `name override` | `terminals` | -| `terminal` | `id`, `name`,`working directory`, `name override` | None | +| Object | Key Properties | Key Elements | +| ------------- | ---------------------------------------------------------------------- | ---------------------- | +| `application` | `name`, `frontmost`, `front window`, `version` | `windows`, `terminals` | +| `window` | `id`, `name`, `selected tab` | `tabs`, `terminals` | +| `tab` | `id`, `name`, `index`, `selected`, `focused terminal`, `name override` | `terminals` | +| `terminal` | `id`, `name`,`working directory`, `name override` | None | `front window` returns the frontmost Ghostty window. `focused terminal` returns the active terminal in a tab, which is useful for scripts that @@ -86,36 +86,36 @@ end tell ### Creation and Layout -| Command | Purpose | Example Syntax | -| ------- | ------- | -------------- | -| `new surface configuration` | Create a reusable surface configuration record. | `set cfg to new surface configuration` | -| `new window` | Create a new window. | `set win to new window with configuration cfg` | -| `new tab` | Create a new tab in an optional target window. | `set t to new tab in win with configuration cfg` | -| `split` | Split a terminal and return the new terminal. | `set t2 to split t1 direction right with configuration cfg` | +| Command | Purpose | Example Syntax | +| --------------------------- | ----------------------------------------------- | ----------------------------------------------------------- | +| `new surface configuration` | Create a reusable surface configuration record. | `set cfg to new surface configuration` | +| `new window` | Create a new window. | `set win to new window with configuration cfg` | +| `new tab` | Create a new tab in an optional target window. | `set t to new tab in win with configuration cfg` | +| `split` | Split a terminal and return the new terminal. | `set t2 to split t1 direction right with configuration cfg` | `split direction` values are `right`, `left`, `down`, and `up`. ### Focus, Selection, and Lifecycle -| Command | Purpose | Example Syntax | -| ------- | ------- | -------------- | -| `focus` | Focus a terminal and bring its window to front. | `focus t1` | -| `activate window` | Bring a window to the front. | `activate window (window 1)` | -| `select tab` | Select a tab. | `select tab (tab 2 of window 1)` | -| `close` | Close a terminal. | `close (terminal 2 of selected tab of window 1)` | -| `close tab` | Close a tab. | `close tab (tab 2 of window 1)` | -| `close window` | Close a window. | `close window (window 1)` | +| Command | Purpose | Example Syntax | +| ----------------- | ----------------------------------------------- | ------------------------------------------------ | +| `focus` | Focus a terminal and bring its window to front. | `focus t1` | +| `activate window` | Bring a window to the front. | `activate window (window 1)` | +| `select tab` | Select a tab. | `select tab (tab 2 of window 1)` | +| `close` | Close a terminal. | `close (terminal 2 of selected tab of window 1)` | +| `close tab` | Close a tab. | `close tab (tab 2 of window 1)` | +| `close window` | Close a window. | `close window (window 1)` | ### Input and Actions -| Command | Purpose | Example Syntax | -| ------- | ------- | -------------- | -| `input text` | Send paste-style text input to a terminal. | `input text "echo hello" to t1` | -| `send key` | Send key press/release events with optional modifiers. | `send key "enter" to t1` | -| `send mouse button` | Send mouse button events. | `send mouse button left button to t1` | -| `send mouse position` | Send pointer position updates. | `send mouse position x 240 y 120 to t1` | -| `send mouse scroll` | Send scroll events with precision/momentum options. | `send mouse scroll x 0 y -8 precision true to t1` | -| `perform action` | Execute a Ghostty action string on a terminal. | `perform action "toggle_fullscreen" on t1` | +| Command | Purpose | Example Syntax | +| --------------------- | ------------------------------------------------------ | ------------------------------------------------- | +| `input text` | Send paste-style text input to a terminal. | `input text "echo hello" to t1` | +| `send key` | Send key press/release events with optional modifiers. | `send key "enter" to t1` | +| `send mouse button` | Send mouse button events. | `send mouse button left button to t1` | +| `send mouse position` | Send pointer position updates. | `send mouse position x 240 y 120 to t1` | +| `send mouse scroll` | Send scroll events with precision/momentum options. | `send mouse scroll x 0 y -8 precision true to t1` | +| `perform action` | Execute a Ghostty action string on a terminal. | `perform action "toggle_fullscreen" on t1` | For `send key` and `send mouse button`, `action` can be `press` or `release`. `modifiers` is a comma-separated string containing any of: