Skip to content

macos: expose tab color via AppleScript#12468

Open
thoutbeckers wants to merge 4 commits into
ghostty-org:mainfrom
thoutbeckers:macos/applescript-tab-color
Open

macos: expose tab color via AppleScript#12468
thoutbeckers wants to merge 4 commits into
ghostty-org:mainfrom
thoutbeckers:macos/applescript-tab-color

Conversation

@thoutbeckers
Copy link
Copy Markdown

Exposes tab color on macos as a readable/writeable AppleScript color property.

Based on Discussions requests:

#11590 (just name was implemented)
#12314 (more recent request)

Claude code was used to generate initial .sdef binding, but I spent some time myself making it (hopefully) more maintainable, including some compile time garantuees if updates the the palette are made in future.

@thoutbeckers thoutbeckers requested a review from a team as a code owner April 25, 2026 22:56
@ghostty-bot ghostty-bot Bot added the os/macos label Apr 25, 2026
Comment thread macos/Ghostty.sdef Outdated
</property>
<property name="index" code="pidx" type="integer" access="r" description="1-based index of this tab in its window."/>
<property name="selected" code="GTsl" type="boolean" access="r" description="Whether this tab is selected in its window."/>
<property name="color" code="GTcl" type="tab color" access="rw" description="The color of the tab.">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we use colr here from standard terminology table

Comment thread macos/Sources/Features/AppleScript/ScriptTab.swift Outdated
Copy link
Copy Markdown
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we should use RGBA.

@thoutbeckers
Copy link
Copy Markdown
Author

I see the first review is already in, thanks.

RGB codes are not actually stable between macos releases, but this way I think collisions won't happen and adding new colors would be fairly easy.

Not allowing arbitrary colors was already the intend I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants