Description
Discussed in #5836
Originally posted by vaygr February 17, 2025
Steps to reproduce:
yabai -m rule --add app="Ghostty" title="^scratchterm$" scratchpad="scratchterm" grid=5:5:1:0:3:3
open -na Ghostty.app --args --title="scratchterm"
Even though the title is reported correctly once ghostty is launched:
{
"id":5281,
"pid":13867,
"app":"Ghostty",
"title":"scratchterm",
"scratchpad":"",
"frame":{
"x":12.0000,
"y":50.0000,
"w":1488.0000,
"h":920.0000
},
"role":"AXWindow",
"subrole":"AXStandardWindow",
"root-window":true,
"display":1,
"space":1,
"level":0,
"sub-level":-20,
"layer":"normal",
"sub-layer":"below",
"opacity":1.0000,
"split-type":"vertical",
"split-child":"second_child",
"stack-index":0,
"can-move":true,
"can-resize":true,
"has-focus":true,
"has-shadow":true,
"has-parent-zoom":false,
"has-fullscreen-zoom":true,
"has-ax-reference":true,
"is-native-fullscreen":false,
"is-visible":true,
"is-minimized":false,
"is-hidden":false,
"is-floating":false,
"is-sticky":false,
"is-grabbed":false
}
But the rule never gets triggered, that is unless I remove title
argument for yabai -m rule
or set it to ^.*$
.
I tested it with kitty to see if it could be yabai's issue, but no, it worked as expected:
yabai -m rule --add app="kitty" title="^scratchterm$" scratchpad="scratchterm" grid=5:5:1:0:3:3
kitty --title "scratchterm"
My assumption is ghostty could be setting the title a bit too late?
Notes
Right now, the core Surface sends a set_title
apprt action AFTER the surface is initialized, which -- at least for macOS -- happens to be after the Window (tabs are also windows in macOS) is created.
If the user sets an explicit title
config, we should set that as part of the window creation process rather than wait for this message.