Skip to content

Feature: Allow terminal/tab/window overrides to be set via AppleScript/JXA (a11y) #12048

Description

@jcollie

Discussed in #12047

Originally posted by mikeschinkel April 1, 2026
There is currently no reliable way to programmatically set a tab name in Ghostty from AppleScript/JXA.

My use-case

I am trying to use h2+shell scripts to orchestrate Ghostty, and find I really need to set tab names programmatically. (Note h2 is directly integrated with and coupled to Ghostty via AppleScript automation.)

Example workflow:

  • h2 attach code-auditor creates or attaches to a tab
  • Ghostty tab title might become: h2 attach code-aud
  • What I would like instead instead: CODE-AUDITOR

This is an accessibility concern for people whose eye sight is not perfect (like mine):

  • Ghostty tab fonts are small
  • Long command-based titles are harder to read
  • Short semantic names would improve legibility

What I tried

  1. OSC escape sequences — Does NOT change tab title

    printf '\033]0;code-auditor\007'
  2. AppleScript / JXA

    const ghostty = Application("Ghostty")
    const tab = ghostty.windows[0].tabs[1]
    tab.name = "My Tab"

    Got:

    Error: Can't set that. Access not allowed. (-10003)
    
  3. Keybind commands — Ghostty provides set_tab_title:<value> but:

  • only accessible via keybind / command palette
  • no external API
  • too easy to conflict with existing global key bindings
  • requires an app update a users Ghostty config
  • is timing-sensitive
  • requires accessibility permissions
  • brittle
  • not suitable OSS code that wants to integrate with Ghostty

Would it be possible to allow AppleScript/JXA to set the tab name?

AppleScript

set name of tab 1 to "CODE-AUDITOR"

JavaScript

tab.name = "CODE-AUDITOR"

My environment

  • macOS Tahoe
  • Ghostty 1.3.1

Activity

  1. added this to the 1.4.0 milestone on Apr 1, 2026
  2. added theissue type on Apr 1, 2026
  3. paaloeye commented on Oct 6, 2026

    @paaloeye
    Contributor

    For posterity, printf '\033]0;code-auditor\007' does work as intended.

  4. added a commit that references this issue on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyA well-scoped, approachable issue for someone looking to contribute.os/macos

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions